X-Git-Url: http://git.shiar.nl/perl/plp/.git/blobdiff_plain/0dbf6bc1fe5cd28c532994d13836e9509fcbe194..9b76d38ad3dc8f7135e5c2b1594e6815790808bc:/eg/plpinfo.plp diff --git a/eg/plpinfo.plp b/eg/plpinfo.plp new file mode 100644 index 0000000..9578327 --- /dev/null +++ b/eg/plpinfo.plp @@ -0,0 +1,76 @@ + + + +plpinfo() + + + + +

PLP Version <:= $PLP::VERSION :>

+ + +<: +use Config; +printf "\n", @$_ for ( + ["System" => qx(uname -snrvm)], + ["Server API" => "CGI/FastCGI - ".$PLP::interface], #TODO + ["Perl" => join ".", map ord, split //, $^V], + ["Build Date" => $Config{cf_time}], + ["Debug Build" => $^P ? "yes" : "no"], + ["Thread Safety" => $Config{usethreads} ? "enabled" : "disabled"], + ["Include Path" => join "; ", @INC], +); +:>
%s%s
+ +

PLP Core

+ + +<: +my %modules; +s!/!::!g, s/\.pm$// and $modules{$_} = $_->VERSION || "" for keys %INC; +printf "\n", @$_ for ( + ["Modules" => join "
\n", + map "$_ $modules{$_}", sort grep /^PLP/, keys %modules + ], + ["Debug Output" => join "; ", + $PLP::DEBUG & 1 ? "run-time errors" : (), + $PLP::DEBUG & 2 ? "headers" : (), + ], + ["Caching" => $PLP::use_cache ? "on" : "off"], #TODO +); +:>
%s%s
+ +

Environment

+ + +<: +s/(?<=,)//g for values %ENV; # allow breaks at commas (HTTP_ACCEPT*) +printf("\n", + $_, defined $ENV{$_} ? $ENV{$_} : "no value" +) for sort keys %ENV; +:>
%s%s
+ +

PLP Variables

+ + +<: +for my $var qw(get post cookies header) { + printf("\n", + $var, $_, defined $$var{$_} ? $$var{$_} : "no value" + ) for sort keys %$var; +} +:>
%s{'%s'}%s
+ + +