Mark Hedges > Apache2-Controller-v1.0.111 > Apache2::Controller::Funk

Download:
A2C/Apache2-Controller-v1.0.111.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  2
Open  0
View/Report Bugs
Module Version: v1.0.111   Source   Latest Release: Apache2-Controller-v1.1.1

NAME ^

Apache2::Controller::Funk

VERSION ^

Version 1.000.111

SYNOPSIS ^

 $bool = controller_allows_method($class, $method); 

 check_allowed_method($class, $method);     # throws NOT_FOUND exception

DESCRPTION ^

Useful routines for both Apache2::Controller and Apache2::Controller::Dispatch objects to run. Results and whether to 'require' are cached in this package's namespace across requests, optimizing efficiency per mod_perl2 child, and are queried futher using 'exists', which is very fast.

IMPORTABLE FUNCTIONS ^

controller_allows_method

 $bool = controller_allows_method($class, $method); # controller_allows_method()

Ask if method name is returned by allowed_methods() in the given controller package.

Only two 'exists' calls are required for each query after caching the first result for this child.

check_allowed_method

 check_allowed_method($method, $class); # check_allowed_method()

Throw a NOT_FOUND exception if the method is not an allowed method in the allowed_methods() list in the controller package.

log_bad_request_reason( )

 log_bad_request_reason( $r, $X );

Call $r->log_reason( $msg, $r->uri() ) where $msg is a truncated version of $X in case $X is too long.

syntax highlighting: