Example #1
0
        static void Credits(InfoWriter writer)
        {
            writer.Header(InfoResources.Credits);

            // TODO: creditz, can we pull it from git?
            writer.Table(new string[][] { }, new[] { "Contribution", "Authors" });
        }
Example #2
0
        private void DoWriteInfoFile(EncodeInfo job)
        {
            InfoWriter writer = new InfoWriter();

            writer.SetJob(job);
            _worker.DoWork += writer.DoWrite;
            Log.Info("InfoWriter.DoWrite()");
        }
Example #3
0
        public Server(string ip, int port)
        {
            _tcpServer  = new TcpListener(IPAddress.Parse(ip), port);
            _infoWriter = InfoWriter.GetInstance();
            _tcpClients = new List <TcpClient>();

            _infoWriter.Write(InfoType.Info, string.Concat("IP: ", ip, " Port: ", port));
        }
Example #4
0
 static void Variables(Context ctx, InfoWriter writer)
 {
     writer.Header("Variables");
     writer.Table(
         ((IDictionary <IntStringKey, PhpValue>)ctx.Request).Select(pair => new[] { $"$_REQUEST['{pair.Key}']", Export(ctx, pair.Value) }).Concat(
             ((IDictionary <IntStringKey, PhpValue>)ctx.Get).Select(pair => new[] { $"$_GET['{pair.Key}']", Export(ctx, pair.Value) }).Concat(
                 ((IDictionary <IntStringKey, PhpValue>)ctx.Post).Select(pair => new[] { $"$_POST['{pair.Key}']", Export(ctx, pair.Value) }).Concat(
                     ((IDictionary <IntStringKey, PhpValue>)ctx.Cookie).Select(pair => new[] { $"$_COOKIE['{pair.Key}']", Export(ctx, pair.Value) }).Concat(
                         ((IDictionary <IntStringKey, PhpValue>)ctx.Server).Select(pair => new[] { $"$_SERVER['{pair.Key}']", Export(ctx, pair.Value) })
                         )))),
         new[] { InfoResources.Variable, InfoResources.Value });
 }
Example #5
0
        public static void LogInfo(string message)
        {
            try
            {
                if (!EnableDebugInfo)
                {
                    return;
                }

                InfoWriter.Write(DateTime.UtcNow.ToString("MM-dd HH:mm:ss.fff") + " " + message);
            }
            catch
            {
            }
        }
Example #6
0
        static void Configuration(Context ctx, InfoWriter writer)
        {
            writer.Header(InfoResources.Configuration);

            foreach (string ext in Context.GetLoadedExtensions())
            {
                //container.EchoTag("h2", ext);
            }

            // TODO: extensions configuration
            var options = StandardPhpOptions.DumpOptions(ctx, null);
            foreach (var opts in options.GroupBy(opt => opt.ExtensionName))
            {
                foreach (var o in opts)
                {
                    //yield return new[] { o.Name, o.LocalValue.ToString(ctx), o.DefaultValue.ToString(ctx) };
                }
            }
        }
        public static void Main()
        {
            try
            {
                Console.Title = "ServerApplication";

                SetConsoleCtrlHandler(Handler, true);

                var appSettings = ConfigurationManager.AppSettings;
                var ip          = appSettings.Get("IP");
                var port        = int.Parse(appSettings.Get("Port"));

                _server = new Server(ip, port);
                _server.TryDoRun();
            }
            catch (Exception e)
            {
                InfoWriter.GetInstance().Write(InfoType.Error, string.Format("Exception: {0}", e));
            }
        }
Example #8
0
 static void Env(Context ctx, InfoWriter writer)
 {
     writer.Header(InfoResources.Environment);
     writer.Table(ctx, ctx.Env, new[] { InfoResources.Variable, InfoResources.Value });
 }
Example #9
0
 public void WriteXml(XmlWriter writer, CultureInfo cultureInfo)
 {
     if (writer == null)
     {
         throw new ArgumentNullException("writer");
     }
     if (cultureInfo == null)
     {
         throw new ArgumentNullException("cultureInfo");
     }
     InfoWriter writer2 = null;
     try
     {
         writer2 = new InfoWriter(writer, cultureInfo);
         this.WriteXml(writer2, cultureInfo);
     }
     finally
     {
         if (writer2 != null)
         {
             try
             {
                 writer2.Close();
             }
             catch
             {
             }
             writer2 = null;
         }
     }
 }
Example #10
0
 public void WriteXml(string fileName, CultureInfo cultureInfo)
 {
     if (fileName == null)
     {
         throw new ArgumentNullException("fileName");
     }
     if (cultureInfo == null)
     {
         throw new ArgumentNullException("cultureInfo");
     }
     InfoWriter writer = null;
     try
     {
         writer = new InfoWriter(fileName, cultureInfo);
         this.WriteXml(writer, cultureInfo);
     }
     finally
     {
         if (writer != null)
         {
             try
             {
                 writer.Close();
             }
             catch
             {
             }
             writer = null;
         }
     }
 }
Example #11
0
 public void WriteXml(Stream outStream, CultureInfo cultureInfo)
 {
     if ((outStream == null) || (outStream == Stream.Null))
     {
         throw new ArgumentNullException("outStream");
     }
     if (cultureInfo == null)
     {
         throw new ArgumentNullException("cultureInfo");
     }
     InfoWriter writer = null;
     try
     {
         writer = new InfoWriter(outStream, cultureInfo);
         this.WriteXml(writer, cultureInfo);
     }
     finally
     {
         if (writer != null)
         {
             try
             {
                 writer.Close();
             }
             catch
             {
             }
             writer = null;
         }
     }
 }