private static void General(HtmlTagWriter container) { using (var table = container.Tag("table")) { Action <string, string> Line = (name, value) => { using (var tr = table.Tag("tr")) { tr.EchoTag("td", name, new { @class = "e" }); tr.EchoTag("td", value, new { @class = "v" }); } }; Line("System", $"{GetOsName()} {System.Environment.MachineName} {RuntimeInformation.OSDescription} {RuntimeInformation.OSArchitecture}"); Line("Architecture", RuntimeInformation.ProcessArchitecture.ToString()); Line("Debug build", #if DEBUG true #else false #endif ? "yes" : "no"); Line("IPv6 Support", System.Net.Sockets.Socket.OSSupportsIPv6 ? "yes" : "no"); Line("Registered PHP Streams", string.Join(", ", Streams.StreamWrapper.SystemStreamWrappers.Keys)); Line("Registered Stream Filters", string.Join(", ", Streams.PhpFilter.GetFilterNames())); } }
private static void PageTitle(HtmlTagWriter container) { using (var table = container.Tag("table")) using (var tr = table.Tag("tr", new { @class = "h" })) using (var td = tr.Tag("td")) { using (var a = td.Tag("a", new { href = Resources.InfoResources.LogoHref, target = "_blank" })) { a.EchoTagSelf("img", new { border = "0", src = Resources.InfoResources.LogoSrc, alt = Resources.InfoResources.LogoAlt }); } using (var title = td.Tag("h1", new { @class = "p" })) { title.EchoEscaped("Peachpie Version " + Core.Utilities.ContextExtensions.GetRuntimeInformationalVersion()); } } }
private static void PageTitle(HtmlTagWriter container) { using (var table = container.Tag("table")) using (var tr = table.Tag("tr", new { @class = "h" })) using (var td = tr.Tag("td")) { using (var a = td.Tag("a", new { href = Resources.InfoResources.LogoHref, target = "_blank" })) { a.EchoTagSelf("img", new { border = "0", src = Resources.InfoResources.LogoSrc, alt = Resources.InfoResources.LogoAlt }); } using (var title = td.Tag("h1", new { @class = "p" })) { title.EchoEscaped("Peachpie Version " + typeof(Context).GetTypeInfo().Assembly.GetName().Version.ToString(3)); // TODO: suffix (-preview...) } } }
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(" "); } 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"); } }
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(" "); } else { td.EchoEscaped(value); } } } }; foreach (var entry in container.Context.Env.Keys) { Line(entry.ToString(), container.Context.Env[entry].ToStringOrNull()); } } }