From 96959bff080392067524996e6edbf95445ba66da Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Sat, 22 Mar 2008 14:47:33 +0000 Subject: [PATCH] move backend interface modules into PLP::Backend:: namespace Keep our namespace a bit organized. --- PLP.pm | 31 +++++++++++++++++-------------- PLP/{ => Backend}/Apache.pm | 10 +++++----- PLP/{ => Backend}/CGI.pm | 10 +++++----- PLP/{ => Backend}/FastCGI.pm | 14 +++++++------- plp.cgi | 2 +- plp.fcgi | 2 +- 6 files changed, 36 insertions(+), 33 deletions(-) rename PLP/{ => Backend}/Apache.pm (90%) rename PLP/{ => Backend}/CGI.pm (91%) rename PLP/{ => Backend}/FastCGI.pm (79%) diff --git a/PLP.pm b/PLP.pm index e5988c6..e7ec30c 100644 --- a/PLP.pm +++ b/PLP.pm @@ -81,12 +81,12 @@ sub error { # Wrap old request handlers. sub everything { - require PLP::CGI; - PLP::CGI::everything(); + require PLP::Backend::CGI; + PLP::Backend::CGI::everything(); } sub handler { - require PLP::Apache; - PLP::Apache::handler(@_); + require PLP::Backend::Apache; + PLP::Backend::Apache::handler(@_); } # Sends the headers waiting in %PLP::Script::header @@ -258,25 +258,25 @@ PLP - Perl in HTML pages =head2 Lighttpd installation -F configuration using L: +F configuration using L: server.modules = ( "mod_fastcgi", ) fastcgi.server = ( ".plp" => (( - "bin-path" => "/usr/bin/perl -MPLP::FastCGI", + "bin-path" => "/usr/bin/perl -MPLP::Backend::FastCGI", "socket" => "/tmp/fcgi-plp.socket", )), ) =head2 Apache installation -F for a L setup: +F for a L setup: SetHandler perl-script - PerlHandler PLP::Apache + PerlHandler PLP::Backend::Apache PerlSendHeader On @@ -293,25 +293,28 @@ F for a L setup: PLP is yet another Perl embedder, primarily for HTML documents. Unlike with other Perl embedders, there is no need to learn a meta-syntax or object model: one can just use the normal Perl constructs. PLP runs under -L and L for speeds comparable -to those of PHP, but can also be run as a standard L script. +L and L +for speeds comparable to those of PHP, but can also be run as a standard +L script. =head2 Setup -See either L, L or L. +See either L, L +or L. At least the following servers are supported: =over 10 =item Lighttpd -With L or L. +With L or L. =item Apache Either version 1 or 2. -Using L, L, -or L. +Using L, +L, +or L. =back diff --git a/PLP/Apache.pm b/PLP/Backend/Apache.pm similarity index 90% rename from PLP/Apache.pm rename to PLP/Backend/Apache.pm index 835f2b4..94d38bf 100644 --- a/PLP/Apache.pm +++ b/PLP/Backend/Apache.pm @@ -1,4 +1,4 @@ -package PLP::Apache; +package PLP::Backend::Apache; use strict; @@ -30,7 +30,7 @@ our $r; sub init { $r = shift; - $PLP::print = 'PLP::Apache::print'; + $PLP::print = 'PLP::Backend::Apache::print'; $PLP::read = \&read; $ENV{PLP_FILENAME} = my $filename = $r->filename; @@ -84,7 +84,7 @@ sub handler { =head1 NAME -PLP::Apache - Apache mod_perl interface for PLP +PLP::Backend::Apache - Apache mod_perl interface for PLP =head1 SYNOPSIS @@ -97,7 +97,7 @@ Setup F (often just create a F) with: SetHandler perl-script - PerlHandler PLP::Apache + PerlHandler PLP::Backend::Apache PerlSendHeader On PerlSetVar PLPcache On @@ -125,5 +125,5 @@ Mischa POSLAWSKY =head1 SEE ALSO -L, L, L +L, L, L diff --git a/PLP/CGI.pm b/PLP/Backend/CGI.pm similarity index 91% rename from PLP/CGI.pm rename to PLP/Backend/CGI.pm index 698c34b..3b4c400 100644 --- a/PLP/CGI.pm +++ b/PLP/Backend/CGI.pm @@ -1,4 +1,4 @@ -package PLP::CGI; +package PLP::Backend::CGI; use strict; @@ -70,7 +70,7 @@ sub everything { $_[0]->init() and PLP::start(); } -# This is run by the CGI script. (#!perl \n use PLP::CGI;) +# This is run by the CGI script. (#!perl \n use PLP::Backend::CGI;) sub import { $_[0]->everything(); } @@ -79,7 +79,7 @@ sub import { =head1 NAME -PLP::CGI - CGI interface for PLP +PLP::Backend::CGI - CGI interface for PLP =head1 SYNOPSIS @@ -87,7 +87,7 @@ For most servers you'll need a script executable. Example F: #!/usr/bin/perl - use PLP::CGI; + use PLP::Backend::CGI; Or install the C included with PLP. @@ -122,5 +122,5 @@ Mischa POSLAWSKY =head1 SEE ALSO -L, L +L, L diff --git a/PLP/FastCGI.pm b/PLP/Backend/FastCGI.pm similarity index 79% rename from PLP/FastCGI.pm rename to PLP/Backend/FastCGI.pm index 7db7296..8ee3261 100644 --- a/PLP/FastCGI.pm +++ b/PLP/Backend/FastCGI.pm @@ -1,10 +1,10 @@ -package PLP::FastCGI; +package PLP::Backend::FastCGI; use strict; -use PLP::CGI; +use PLP::Backend::CGI; use FCGI; -use base 'PLP::CGI'; +use base 'PLP::Backend::CGI'; our $VERSION = '1.00'; @@ -22,7 +22,7 @@ sub import { =head1 NAME -PLP::FastCGI - FastCGI interface for PLP +PLP::Backend::FastCGI - FastCGI interface for PLP =head1 SYNOPSIS @@ -33,7 +33,7 @@ to enable I (add/outcomment in server.modules), and add: fastcgi.server = ( ".plp" => (( - "bin-path" => "/usr/bin/perl -MPLP::FastCGI", + "bin-path" => "/usr/bin/perl -MPLP::Backend::FastCGI", "socket" => "/tmp/fcgi-plp.socket", )), ) @@ -44,7 +44,7 @@ You'll need a dispatch script (F is included with PLP). Example F: #!/usr/bin/perl - use PLP::FastCGI; + use PLP::Backend::FastCGI; Then enable either I or I, and setup F (often just create a F) with: @@ -65,5 +65,5 @@ Mischa POSLAWSKY =head1 SEE ALSO -L, L, L +L, L, L diff --git a/plp.cgi b/plp.cgi index c4094d7..58cb1d0 100755 --- a/plp.cgi +++ b/plp.cgi @@ -3,5 +3,5 @@ # Executable to serve PLP scripts using CGI. # Not installed automatically, and only needed for CGI installations. -use PLP::CGI; +use PLP::Backend::CGI; diff --git a/plp.fcgi b/plp.fcgi index 372459e..1eabbdb 100755 --- a/plp.fcgi +++ b/plp.fcgi @@ -3,5 +3,5 @@ # This is a dispatch script for FastCGI installations. # It is not needed with normal CGI or mod_perl. -use PLP::FastCGI; +use PLP::Backend::FastCGI; -- 2.30.0