FastCGI interface (PLP::CGI extension using FCGI)
[perl/plp/.git] / PLP / FastCGI.pm
diff --git a/PLP/FastCGI.pm b/PLP/FastCGI.pm
new file mode 100644 (file)
index 0000000..e16fbcb
--- /dev/null
@@ -0,0 +1,22 @@
+package PLP::FastCGI;
+
+use strict;
+
+use PLP::CGI;
+use FCGI;
+use base 'PLP::CGI';
+
+our $VERSION = '1.00';
+
+sub import {
+       my $self = shift;
+       my $request = FCGI::Request();
+       while ($request->Accept() >= 0) {
+               $PLP::use_cache = !defined $ENV{PLP_CACHE} || $ENV{PLP_CACHE}; # before it's clean()ed
+               delete $ENV{PATH_TRANSLATED};
+               $self->everything();
+       }
+}
+
+1;
+