Home / Documentation / 2.0 / API / | ||||
Apache2::Const - Perl Interface for Apache Constants | ||||
|
||
:cmd_how
:common
:config
:conn_keepalive
:context
:filter_type
:http
Apache2::Const::HTTP_ACCEPTED
Apache2::Const::HTTP_BAD_GATEWAY
Apache2::Const::HTTP_BAD_REQUEST
Apache2::Const::HTTP_CONFLICT
Apache2::Const::HTTP_CONTINUE
Apache2::Const::HTTP_CREATED
Apache2::Const::HTTP_EXPECTATION_FAILED
Apache2::Const::HTTP_FAILED_DEPENDENCY
Apache2::Const::HTTP_FORBIDDEN
Apache2::Const::HTTP_GATEWAY_TIME_OUT
Apache2::Const::HTTP_GONE
Apache2::Const::HTTP_INSUFFICIENT_STORAGE
Apache2::Const::HTTP_INTERNAL_SERVER_ERROR
Apache2::Const::HTTP_LENGTH_REQUIRED
Apache2::Const::HTTP_LOCKED
Apache2::Const::HTTP_METHOD_NOT_ALLOWED
Apache2::Const::HTTP_MOVED_PERMANENTLY
Apache2::Const::HTTP_MOVED_TEMPORARILY
Apache2::Const::HTTP_MULTIPLE_CHOICES
Apache2::Const::HTTP_MULTI_STATUS
Apache2::Const::HTTP_NON_AUTHORITATIVE
Apache2::Const::HTTP_NOT_ACCEPTABLE
Apache2::Const::HTTP_NOT_EXTENDED
Apache2::Const::HTTP_NOT_FOUND
Apache2::Const::HTTP_NOT_IMPLEMENTED
Apache2::Const::HTTP_NOT_MODIFIED
Apache2::Const::HTTP_NO_CONTENT
Apache2::Const::HTTP_OK
Apache2::Const::HTTP_PARTIAL_CONTENT
Apache2::Const::HTTP_PAYMENT_REQUIRED
Apache2::Const::HTTP_PRECONDITION_FAILED
Apache2::Const::HTTP_PROCESSING
Apache2::Const::HTTP_PROXY_AUTHENTICATION_REQUIRED
Apache2::Const::HTTP_RANGE_NOT_SATISFIABLE
Apache2::Const::HTTP_REQUEST_ENTITY_TOO_LARGE
Apache2::Const::HTTP_REQUEST_TIME_OUT
Apache2::Const::HTTP_REQUEST_URI_TOO_LARGE
Apache2::Const::HTTP_RESET_CONTENT
Apache2::Const::HTTP_SEE_OTHER
Apache2::Const::HTTP_SERVICE_UNAVAILABLE
Apache2::Const::HTTP_SWITCHING_PROTOCOLS
Apache2::Const::HTTP_TEMPORARY_REDIRECT
Apache2::Const::HTTP_UNAUTHORIZED
Apache2::Const::HTTP_UNPROCESSABLE_ENTITY
Apache2::Const::HTTP_UNSUPPORTED_MEDIA_TYPE
Apache2::Const::HTTP_UPGRADE_REQUIRED
Apache2::Const::HTTP_USE_PROXY
Apache2::Const::HTTP_VARIANT_ALSO_VARIES
:input_mode
:log
:methods
Apache2::Const::METHODS
Apache2::Const::M_BASELINE_CONTROL
Apache2::Const::M_CHECKIN
Apache2::Const::M_CHECKOUT
Apache2::Const::M_CONNECT
Apache2::Const::M_COPY
Apache2::Const::M_DELETE
Apache2::Const::M_GET
Apache2::Const::M_INVALID
Apache2::Const::M_LABEL
Apache2::Const::M_LOCK
Apache2::Const::M_MERGE
Apache2::Const::M_MKACTIVITY
Apache2::Const::M_MKCOL
Apache2::Const::M_MKWORKSPACE
Apache2::Const::M_MOVE
Apache2::Const::M_OPTIONS
Apache2::Const::M_PATCH
Apache2::Const::M_POST
Apache2::Const::M_PROPFIND
Apache2::Const::M_PROPPATCH
Apache2::Const::M_PUT
Apache2::Const::M_REPORT
Apache2::Const::M_TRACE
Apache2::Const::M_UNCHECKOUT
Apache2::Const::M_UNLOCK
Apache2::Const::M_UPDATE
Apache2::Const::M_VERSION_CONTROL
:mpmq
Apache2::Const::MPMQ_NOT_SUPPORTED
Apache2::Const::MPMQ_STATIC
Apache2::Const::MPMQ_DYNAMIC
Apache2::Const::MPMQ_MAX_DAEMON_USED
Apache2::Const::MPMQ_IS_THREADED
Apache2::Const::MPMQ_IS_FORKED
Apache2::Const::MPMQ_HARD_LIMIT_DAEMONS
Apache2::Const::MPMQ_HARD_LIMIT_THREADS
Apache2::Const::MPMQ_MAX_THREADS
Apache2::Const::MPMQ_MIN_SPARE_DAEMONS
Apache2::Const::MPMQ_MIN_SPARE_THREADS
Apache2::Const::MPMQ_MAX_SPARE_DAEMONS
Apache2::Const::MPMQ_MAX_SPARE_THREADS
Apache2::Const::MPMQ_MAX_REQUESTS_DAEMON
Apache2::Const::MPMQ_MAX_DAEMONS
:options
:override
:platform
:remotehost
:satisfy
:types
:proxy
# make the constants available but don't import them use Apache2::Const -compile => qw(constant names ...); # w/o the => syntax sugar use Apache2::Const ("-compile", qw(constant names ...)); # compile and import the constants use Apache2::Const qw(constant names ...);
This package contains constants specific to Apache
features.
mod_perl 2.0 comes with several hundreds of constants, which you don't want to make available to your Perl code by default, due to CPU and memory overhead. Therefore when you want to use a certain constant you need to explicitly ask to make it available.
For example, the code:
use Apache2::Const -compile => qw(FORBIDDEN OK);
makes the constants Apache2::Const::FORBIDDEN
and Apache2::Const::OK
available
to your code, but they aren't imported. In which case you need to use
a fully qualified constants, as in:
return Apache2::Const::OK;
If you drop the argument -compile
and write:
use Apache2::Const qw(FORBIDDEN OK);
Then both constants are imported into your code's namespace and can be used standalone like so:
return OK;
Both, due to the extra memory requirement, when importing symbols, and
since there are constants in other namespaces (e.g.,
APR::
and
ModPerl::
, and non-mod_perl
modules) which may contain the same names, it's not recommended to
import constants. I.e. you want to use the -compile
construct.
Finaly, in Perl =>
is almost the same as the comma operator. It
can be used as syntax sugar making it more clear when there is a
key-value relation between two arguments, and also it automatically
parses its lefthand argument (the key) as a string, so you don't need
to quote it.
If you don't want to use that syntax, instead of writing:
use Apache2::Const -compile => qw(FORBIDDEN OK);
you could write:
use Apache2::Const "-compile", qw(FORBIDDEN OK);
and for parentheses-lovers:
use Apache2::Const ("-compile", qw(FORBIDDEN OK));
:cmd_how
use Apache2::Const -compile => qw(:cmd_how);
The :cmd_how
constants group is used in
Apache2::Module::add()
and
$cmds->args_how
.
:conn_keepalive
use Apache2::Const -compile => qw(:conn_keepalive);
The :conn_keepalive
constants group is used by the
($c->keepalive
)
method.
Apache2::Const::CONN_KEEPALIVE
The connection will be kept alive at the end of the current HTTP request.
Apache2::Const::CONN_UNKNOWN
The connection is at an unknown state, e.g., initialized but not open yet.
:context
use Apache2::Const -compile => qw(:context);
The :context
group is used by the
$parms->check_cmd_context
method.
Apache2::Const::NOT_IN_DIR_LOC_FILE
The command is not in a <Files>/<FilesMatch>, <Location>/<LocationMatch> or <Directory> block.
:filter_type
use Apache2::Const -compile => qw(:filter_type);
The :filter_type
group is for XXX constants.
:input_mode
use Apache2::Const -compile => qw(:input_mode);
The :input_mode
group is used by
get_brigade
.
:methods
use Apache2::Const -compile => qw(:methods);
The :methods
constants group is used in conjunction with
$r->method_number
.
:options
use Apache2::Const -compile => qw(:options);
The :options
group contains constants corresponding to the
Options
configuration directive. For examples see:
$r->allow_options
.
:override
use Apache2::Const -compile => qw(:override);
The :override
group contains constants corresponding to the
AllowOverride
configuration directive. For examples see:
$r->allow_options
.
Apache2::Const::EXEC_ON_READ
Force directive to execute a command which would modify the
configuration (like including another file, or IFModule
)
Apache2::Const::OR_ALL
Apache2::Const::OR_LIMIT
|
Apache2::Const::OR_OPTIONS
|
Apache2::Const::OR_FILEINFO
|
Apache2::Const::OR_AUTHCFG
|
Apache2::Const::OR_INDEXES
Apache2::Const::OR_AUTHCFG
*.conf inside <Directory>
or <Location>
and
.htaccess when AllowOverride AuthConfig
Apache2::Const::OR_LIMIT
*.conf inside <Directory>
or <Location>
and
.htaccess when AllowOverride Limit
:platform
use Apache2::Const -compile => qw(:platform);
The :platform
group is for constants that may
differ from OS to OS.
:remotehost
use Apache2::Const -compile => qw(:remotehost);
The :remotehost
constants group is is used by the
$c->get_remote_host
method.
:satisfy
use Apache2::Const -compile => qw(:satisfy);
The :satisfy
constants group is used in conjunction with
$r->satisfies
.
:proxy
use Apache2::Const -compile => qw(:proxy);
The :proxy
constants group is used in conjunction with
$r->proxyreq
.
mod_perl 2.0 and its core modules are copyrighted under The Apache Software License, Version 2.0.
|