Gantry::Engine::MP13 - mod_perl 1.0 plugin ( or mixin )


  use Gantry::Engine::MP13;


This module is the binding between the Gantry framework and the mod_perl API. This particluar module contains the mod_perl 1.0 specific bindings.

See mod_perl documentation for a more detailed description for some of these bindings.



Return a hash reference to the apache request body parameters.


Return a hash reference to the apache request body parameters unfiltered.


Apache::Request is a subclass of the Apache class, which adds methods for parsing GET requests and POST requests where Content-type is one of application/x-www-form-urlencoded or multipart/form-data. See the libapreq(3) manpage for more details.


Returns the physical server this connection came in on (main server or vhost):


Returns the virtual server name


Called by the handler in when things go wrong. It receives html output and a death message. It logs the death message and sets the html output via the custom_response routine of the request object. Returns FORBIDDEN status code.


This must be used by a plugin at the pre_init phase. It takes all of the data from the body of the HTTP POST request, storing it for retrieval via get_post_body. You cannot mix this with regular form handling.


Returns the proper numeric status code for DECLINED.


The uri tail specific to this request. Returns:

    $self->uri, $self->location

Note that this is a two element list.


Returns the name of the engine, i.e. Gantry::Engine::MP13


Receives the request object and stores it in the site object. Returns nothing useful.


The $r->err_headers_out method will return a %hash of server response headers. This can be used to initialize a perl hash, or one could use the $r->err_header_out() method (described below) to retrieve or set a specific header value directly

See mod_perl docs.


Pass this method the name of a conf parameter you need. Returns the value for the parameter.


Returns the location for the current request.


Returns the HTTP method of the current request.


Returns the path info for the current request.


Returns the uri for the current request.


Returns the currently logged-in user.

    returns a hash of url arguments.


Same as get_dbh, but for the authentication database.


Users should call get_config instead.

Pulls the config object out of the pnotes so Gantry::Conf doesn't have to regenerate it repeatedly. (See set_cached_config.)


If you are using Gantry::Conf, this will return the config hash reference for the current location.


These cache the Gantry::Conf config hash in pnotes. Override them if you want more persistent caching. These are instance methods. get receives the invoking object, the name of the GantryConfInstance, and the current location (for ease of use, its also in the invocant). set receives those plus the conf hash it should cache.


Returns the current regular database connection if one is available or undef otherwise.


If consume_post_body was used by a plugin during the pre_init phase, this method returns the consumed body of the HTTP POST request.


The $r->headers_in method will return a %hash of client request headers. This can be used to initialize a perl hash, or one could use the $r->header_in() method (described below) to retrieve a specific header value directly.

See mod_perl docs.

$self->header_out( $r, $header_key, $header_value )

Change the value of a response header, or create a new one.


Return whether the current request is being served by an SSL-enabled host.


Returns a true value if the status is currently DECLINED or false otherwise.

$self->log_error( message )

Writes message to the apache web server log


Returns port number in which the request came in on.

$self->print_output( $response_page )

This method sends the contents of $response page back to apache. It uses the print method on the request object.


Returns the proper numeric status code for REDIRECT.


Returns the IP address for the remote user


Returns the content of custom_error. It gives $@ to the custom_error method.

$self->send_http_header( $r )

Send the response line and all headers to the client. Takes an optional parameter indicating the content-type of the response, i.e. 'text/html'.

This method will create headers from the $r->content_xxx() and $r->no_cache() attributes (described below) and then append the headers defined by $r->header_out (or $r->err_header_out if status indicates an error).

See mod_perl 1.0 docs.


Returns the value set by the top-level ServerRoot directive


For internal use. Used to place a config hash into pnotes for reuse during the current page request.


Sets the content type stored in the site object's content_type attribute on the apache request object.


Sets the no_cache flag in the apache request object with the value for no_cache in the site object.


Sets up the apreq object and the form parameters from it.

$self->status_const( 'OK | DECLINED | REDIRECT' )

Get or set the reply status for the client request. The Apache::Constants module provide mnemonic names for the status codes.


Returns the proper numeric status code for OK.


Accepts a value and returns it url encoded.


Accepts a value and returns it url decoded.


Uploads a file from the client's disk.

Parameter: The name of the file input element on the html form.

Returns: A hash with these keys:


a unique identifier for this upload


the base name of the file


the extension (file type) of the file




bytes in file


mime type of file


a handle you can read the file from


mod_perl(3), Gantry(3)



Tim Keefer <>


Copyright (c) 2005-6, Tim Keefer.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.