Plack::App::FakeApache - Wrapping mod_perl2 applications in Plack
use Plack::App::FakeApache; my $app = Plack::App::FakeApache->new( response_handler => "My::ResponseHandler" dir_config => { ... } )->to_app;
Plack::App::FakeApache transforms a mod_perl2 application into a PSGI application
This is Proof of Concept code originating in the mocking code developed to test an internal very non-trivial mod_perl2 application. Features have been added on a need to have basis.
*_handler arguments support multiple "stacked" handlers if passed as an arrayref.
Handlers for the respective request phases. Pass a blessed object, a class name or use the Class->method syntax. See the mod_perl docs for calling conventions.
Class->method
Hash used to resolve $req->dir_config() requests
Root directory of the file system (optional, defaults to the current working directory)
The destination of the log messages (i.e. the errorlog). This should be a file handle
Aditional args passed to the fake request object. E.g. auth_name and auth_type.
The following methods from Apache2::RequestRec and mixins are supported:
A few methods have been added to the interface to enable interaction with Plack:
Returns the underling Plack::Request object
Returns the underlying Plack::Response object. During the request phase this is incomplete.
Fills information into the response object and finalizes it.
Peter Makholm, peter@makholm.net
To install Plack::App::FakeApache, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Plack::App::FakeApache
CPAN shell
perl -MCPAN -e shell install Plack::App::FakeApache
For more information on module installation, please visit the detailed CPAN module installation guide.