=head1 NAME
Apache2::Const - Perl Interface for Apache Constants
=head1 Synopsis
# 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 ...);
=head1 Description
This package contains constants specific to C 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 C and C 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 C<-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.,
C> and
C>, 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 C<-compile> construct.
Finaly, in Perl C<=E> 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));
=head1 Constants
=head2 C<:cmd_how>
use Apache2::Const -compile => qw(:cmd_how);
The C<:cmd_how> constants group is used in
C>
and
Cargs_how|docs::2.0::api::Apache2::Command/C_args_how_>>.
=head3 C
One of I or I (L).
=over
=item since: 2.0.00
=back
=head3 C
One argument, occuring multiple times (L).
=over
=item since: 2.0.00
=back
=head3 C
Two arguments, the second occurs multiple times (L).
=over
=item since: 2.0.00
=back
=head3 C
No arguments at all (L).
=over
=item since: 2.0.00
=back
=head3 C
The command will parse the command line itself (L).
=over
=item since: 2.0.00
=back
=head3 C
One argument only (L).
=over
=item since: 2.0.00
=back
=head3 C
One or two arguments (L).
=over
=item since: 2.0.00
=back
=head3 C
One, two or three arguments (L).
=over
=item since: 2.0.00
=back
=head3 C
One or three arguments (L).
=over
=item since: 2.0.00
=back
=head3 C
Two arguments (L).
=over
=item since: 2.0.00
=back
=head3 C
Two or three arguments (L).
=over
=item since: 2.0.00
=back
=head3 C
Three arguments (L).
=over
=item since: 2.0.00
=back
=head2 C<:common>
use Apache2::Const -compile => qw(:common);
The C<:common> group is for XXX constants.
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head2 C<:config>
use Apache2::Const -compile => qw(:config);
The C<:config> group is for XXX constants.
=head3 C
=over
=item since: 2.0.00
=back
=head2 C<:conn_keepalive>
use Apache2::Const -compile => qw(:conn_keepalive);
The C<:conn_keepalive> constants group is used by the
(Ckeepalive|docs::2.0::api::Apache2::Connection/C_keepalive_>>)
method.
=head3 C
The connection will be closed at the end of the current HTTP request.
=over
=item since: 2.0.00
=back
=head3 C
The connection will be kept alive at the end of the current HTTP request.
=over
=item since: 2.0.00
=back
=head3 C
The connection is at an unknown state, e.g., initialized but not open
yet.
=over
=item since: 2.0.00
=back
=head2 C<:context>
use Apache2::Const -compile => qw(:context);
The C<:context> group is used by the
Ccheck_cmd_context|docs::2.0::api::Apache2::CmdParms/C_check_cmd_context_>>
method.
=head3 C
The command is not in a EVirtualHostE block.
=over
=item since: 2.0.00
=back
=head3 C
The command is not in a ELimitE block.
=over
=item since: 2.0.00
=back
=head3 C
The command is not in a EDirectoryE block.
=over
=item since: 2.0.00
=back
=head3 C
The command is not in a ELocationE/ELocationMatchE block.
=over
=item since: 2.0.00
=back
=head3 C
The command is not in a EFilesE/EFilesMatchE block.
=over
=item since: 2.0.00
=back
=head3 C
The command is not in a EFilesE/EFilesMatchE,
ELocationE/ELocationMatchE or
EDirectoryE block.
=over
=item since: 2.0.00
=back
=head3 C
The directive appears outside of any container directives.
=over
=item since: 2.0.00
=back
=head2 C<:filter_type>
use Apache2::Const -compile => qw(:filter_type);
The C<:filter_type> group is for XXX constants.
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head2 C<:http>
use Apache2::Const -compile => qw(:http);
The C<:http> group is for XXX constants.
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head2 C<:input_mode>
use Apache2::Const -compile => qw(:input_mode);
The C<:input_mode> group is used by
C>.
=head3 C
=over
=item since: 2.0.00
=back
See
C>.
=head3 C
=over
=item since: 2.0.00
=back
See
C>.
=head3 C
=over
=item since: 2.0.00
=back
See
C>.
=head3 C
=over
=item since: 2.0.00
=back
See
C>.
=head3 C
=over
=item since: 2.0.00
=back
See
C>.
=head3 C
=over
=item since: 2.0.00
=back
See
C>.
=head2 C<:log>
use Apache2::Const -compile => qw(:log);
The C<:log> group is for constants used by
C>.
=head3 C
=over
=item since: 2.0.00
=back
See C>.
=head3 C
=over
=item since: 2.0.00
=back
See C>.
=head3 C
=over
=item since: 2.0.00
=back
See C>.
=head3 C
=over
=item since: 2.0.00
=back
See C>.
=head3 C
=over
=item since: 2.0.00
=back
See C>.
=head3 C
=over
=item since: 2.0.00
=back
See C>.
=head3 C
=over
=item since: 2.0.00
=back
See C>.
=head3 C
=over
=item since: 2.0.00
=back
See C>.
=head3 C
=over
=item since: 2.0.00
=back
See C>.
=head3 C
=over
=item since: 2.0.00
=back
See C>.
=head3 C
=over
=item since: 2.0.00
=back
See C>.
=head2 C<:methods>
use Apache2::Const -compile => qw(:methods);
The C<:methods> constants group is used in conjunction with
Cmethod_number|docs::2.0::api::Apache2::RequestRec/C_method_number_>>.
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
corresponds to the HTTP C method
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
corresponds to the HTTP C method
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
corresponds to the HTTP C method
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head2 C<:mpmq>
use Apache2::Const -compile => qw(:mpmq);
The C<:mpmq> group is for querying MPM properties.
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head2 C<:options>
use Apache2::Const -compile => qw(:options);
The C<:options> group contains constants corresponding to the
C configuration directive. For examples see:
Callow_options|docs::2.0::api::Apache2::Access/C_allow_options_>>.
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head3 C
=over
=item since: 2.0.00
=back
=head2 C<:override>
use Apache2::Const -compile => qw(:override);
The C<:override> group contains constants corresponding to the
C configuration directive. For examples see:
Callow_options|docs::2.0::api::Apache2::Access/C_allow_overrides_>>.
=head3 C
F<*.conf> inside CDirectoryE> or CLocationE>
=over
=item since: 2.0.00
=back
=head3 C
Force directive to execute a command which would modify the
configuration (like including another file, or C)
=over
=item since: 2.0.00
=back
=head3 C
C> |
C> |
C> |
C> |
C>
=over
=item since: 2.0.00
=back
=head3 C
F<*.conf> inside CDirectoryE> or CLocationE> and
F<.htaccess> when C
=over
=item since: 2.0.00
=back
=head3 C
F<*.conf> anywhere and F<.htaccess> when C
=over
=item since: 2.0.00
=back
=head3 C
F<*.conf> anywhere and F<.htaccess> when C
=over
=item since: 2.0.00
=back
=head3 C