| PApp documentation | view source | Contained in the PApp distribution. |
PApp::CGI - use PApp in a CGI environment
use PApp::CGI;
# initialize request and do initialization
init PApp::CGI and PApp::config_eval {
configure PApp ...;
$handler = mount_app "admin";
configured PApp;
};
# then for each request do
&$handler;
This module can be used to run PApp applications in CGI environments e.g. using CGI::SpeedyCGI or plain CGI. The startup-penalty for PApp is immense (a second or so) and is dominated by compilation time, so while PApp is usable with "pure" CGI in some applications a CGI-Accelerator that keeps application in memory is certainly recommended.
The $PApp::request-object (as returned by new <PApp::CGI::Request>) is
mostly compatible to Apache, except for missing methods (which could be
added quite easily on request).
This class only contains one user-visible-method: init.
This method should be called once for each request, to initialize the request structure. It also checks wether this is the first request served by this process and returns true. For all subsequent requests it returns false. This can be used to configure PApp once.
This class implements the $request object required by a PApp
handler. The methods in this class are mostly identical to the methods
supported by the Apache module.
This expands the relative url into an absolute one and generates an external redirect.
Reads file/pipe/whatever specified with $filehandle (not a fd!) and
outputs it until it is exhausted.
This class implements the connection object returned by
$request-conenction). The methods in this class are mostly identical
to the methods supported by the conenction object in the Apache module.
Marc Lehmann <schmorp@schmorp.de> http://home.schmorp.de/
| PApp documentation | view source | Contained in the PApp distribution. |