示例#1
0
        private static void Configuration(HtmlTagWriter container, Context ctx)
        {
            container.EchoTag("h1", "Configuration");

            var extensions = Context.GetLoadedExtensions();

            foreach (string ext in extensions)
            {
                container.EchoTag("h2", ext);
            }

            // TODO: extensions configuration
            var options = StandardPhpOptions.DumpOptions(ctx, null);

            foreach (var extensionopt in options.GroupBy(opt => opt.ExtensionName))
            {
            }
        }
示例#2
0
        private static void Variables(HtmlTagWriter container)
        {
            container.EchoTag("h2", "PHP Variables");
            using (var table = container.Tag("table"))
            {
                using (var tr = table.Tag("tr", new { @class = "h" }))
                {
                    tr.EchoTag("th", "Variable");
                    tr.EchoTag("th", "Value");
                }

                Action <string, string> Line = (name, value) =>
                {
                    using (var tr = table.Tag("tr", new { @class = "h" }))
                    {
                        tr.EchoTag("td", name, new { @class = "e" });
                        using (var td = tr.Tag("td", new { @class = "v" }))
                        {
                            if (string.IsNullOrEmpty(value))
                            {
                                td.EchoRaw("&nbsp;");
                            }
                            else
                            {
                                td.EchoEscaped(value);
                            }
                        }
                    }
                };

                Action <PhpArray, string> DumpArray = (arr, name) =>
                {
                    foreach (var entry in arr.Keys)
                    {
                        Line($"{name}[{entry}]", arr[entry].ToStringOrNull());
                    }
                };

                DumpArray(container.Context.Cookie, "_COOKIE");
                DumpArray(container.Context.Server, "_SERVER");
            }
        }
示例#3
0
        private static void Env(HtmlTagWriter container)
        {
            container.EchoTag("h2", "Environment");
            using (var table = container.Tag("table"))
            {
                using (var tr = table.Tag("tr", new { @class = "h" }))
                {
                    tr.EchoTag("th", "Variable");
                    tr.EchoTag("th", "Value");
                }

                Action <string, string> Line = (name, value) =>
                {
                    using (var tr = table.Tag("tr", new { @class = "h" }))
                    {
                        tr.EchoTag("td", name, new { @class = "e" });
                        using (var td = tr.Tag("td", new { @class = "v" }))
                        {
                            if (string.IsNullOrEmpty(value))
                            {
                                td.EchoRaw("&nbsp;");
                            }
                            else
                            {
                                td.EchoEscaped(value);
                            }
                        }
                    }
                };

                foreach (var entry in container.Context.Env.Keys)
                {
                    Line(entry.ToString(), container.Context.Env[entry].ToStringOrNull());
                }
            }
        }
示例#4
0
        private static void Credits(HtmlTagWriter container)
        {
            container.EchoTag("h1", "Credits");

            // TODO: creditz, can we pull it from git?
        }