Apache2-Translation
view release on metacpan or search on metacpan
tied to "$r->method"
$QUERY_STRING
tied to "$r->args"
$FILENAME
tied to "$r->filename"
$DOCROOT
tied to "$r->document_root"
$HOSTNAME
tied to "$r->hostname"
$PATH_INFO
tied to "$r->path_info"
$REQUEST
tied to "$r->the_request"
$HEADERS
tied to "$r->headers_in"
$C tied to "$r->connection"
$CLIENTIP
tied to "$r->connection->remote_ip"
$KEEPALIVE
tied to "$r->connection->keepalive"
For more information see Apache2::RequestRec.
$MATCHED_URI
tied to "$r->notes('Apache2::Translation::n::uri')"
$MATCHED_PATH_INFO
tied to "$r->notes('Apache2::Translation::n::pathinfo')"
While in "PROC" state the incoming uri is split in 2 parts. The
first part is matching the "uri" field of a database record. The
second part is the rest. They can be accessed as $MATCHED_URI and
$MATCHED_PATH_INFO.
$KEY
the current key.
Tied to "$r->notes('Apache2::Translation::n::key')"
$STATE
the current processing state.
$RC Normally, "Apache2::Translation" checks at the end if "$r->filename"
is set. If so, it returns "Apache2::Const::OK" to its caller. If
not, "Apache2::Const::DECLINED" is returned. The first alternative
signals that the *Uri Translation Phase* is done and no further
handlers are to be called in this phase. The second alternative says
that subsequent handlers are to be called. Thus, "mod_alias" or the
core translation handler see the request.
Setting $RC your action decide what is returned.
$RC is also set by the "PerlHandler" action. Modperl generated
responses are normally not associated with a single file on disk.
$DEBUG
tied to "$r->notes('Apache2::Translation::n::debug')"
If set to 1 or 2 debugging output is sent to the "error_log".
%CTX
a hash to store arbitrary data. It can be used to pass data between
action blocks. But note, it is localized to the translation handler.
So, it cannot be used to pass data between different phases of the
apache request cycle. Use "$r->notes" or "$r->pnotes" for that.
APACHE CONFIGURATION DIRECTIVES
After installed and loaded by
PerlLoadModule Apache2::Translation
in your "httpd.conf" "Apache2::Translation" is configured with the
following directives:
<TranslationProvider class> ... </TranslationProvider>
Currently there are 3 provider classes implemented,
Apache2::Translation::DB, Apache2::Translation::File and
Apache2::Translation::BDB.
The ellipsis represents configuration lines formatted as
NAME VALUE
These lines are passed as parameters to the provider. "NAME" is case
insensitive and is converted to lowercase before passed to the
provider object. Spaces round "VALUE" are stripped off. If "VALUE"
begins and ends with the same quotation character (double quote or
single quote) they are also stripped off.
If "VALUE" is not quoted or is quoted with double quote characters
then it is subject to environment variable expansion. All substrings
that match "${VAR}" are replaced by the environment variable "VAR".
The provider object is then created by:
$Apache2::Translation::class->new( NAME1=>VALUE1, NAME2=>VALUE2, ... );
where "class" is exchanged by the actual provider name.
TranslationProvider class param1 param2 ...
This is an alternative way to specify translation provider
parameters.
Each parameter is expected to be a string formatted as
NAME=VALUE
There must be no spaces around the equal sign. The list is passed to
the constructor of the provider class as named parameters:
$Apache2::Translation::class->new( NAME1=>VALUE1, NAME2=>VALUE2, ... );
( run in 2.317 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )