set $PLP::interface to executing backend
authorMischa POSLAWSKY <perl@shiar.org>
Wed, 28 May 2008 05:42:08 +0000 (05:42 +0000)
committerMischa POSLAWSKY <perl@shiar.org>
Wed, 28 May 2008 10:49:14 +0000 (10:49 +0000)
Useful to know how we're running, as code may want to target specific
backends.  Currently undocumented so that behaviour can be changed
easily if need be.

PLP/Backend/Apache.pm
PLP/Backend/CGI.pm
PLP/Backend/FastCGI.pm
eg/plpinfo.plp

index eb13d361e44f4f01656e53755e76833e1b7deee3..62caadcb1e2b5debb3af827a9639667db749c16e 100644 (file)
@@ -71,6 +71,7 @@ sub print {
 # This is the mod_perl handler.
 sub handler {
        PLP::clean();
+       $PLP::interface = __PACKAGE__;
        if (my $ret = init($_[0])) {
                return $ret;
        }
index 1a4f49c8e765d52985fb67c6cf155ee285ddbe5b..e4bcf1edd3d5d0e019df5133faeb68dadfd79ebc 100644 (file)
@@ -72,6 +72,7 @@ sub everything {
 
 # This is run by the CGI script. (#!perl \n use PLP::Backend::CGI;)
 sub import {
+       $PLP::interface = $_[0];
        $_[0]->everything();
 }
 
index 85a5234b75cbc325fe8455ca832c188a9513d0f4..8594a852d7690de911bc1f16b28a087e99707fc0 100644 (file)
@@ -10,6 +10,7 @@ our $VERSION = '1.01';
 
 sub import {
        my $self = shift;
+       $PLP::interface = $self;
        my $request = FCGI::Request();
        $SIG{TERM} = sub {
                $request->LastCall();
index 95783279858335b5911a3cd05a9927c5f250793b..748d40c93690444f0c1f38a7111d8e66c257e7ed 100644 (file)
@@ -24,7 +24,7 @@
 use Config;
 printf "<tr><th>%s</th><td>%s</td></tr>\n", @$_ for (
        ["System"     => qx(uname -snrvm)],
-       ["Server API" => "CGI/FastCGI - ".$PLP::interface], #TODO
+       ["Server API" => $PLP::interface ? $PLP::interface : "?"],
        ["Perl"       => join ".", map ord, split //, $^V],
        ["Build Date" => $Config{cf_time}],
        ["Debug Build" => $^P ? "yes" : "no"],