📄 const.pm
字号:
# Copyright 2001-2005 The Apache Software Foundation## Licensed under the Apache License, Version 2.0 (the "License");# you may not use this file except in compliance with the License.# You may obtain a copy of the License at## http://www.apache.org/licenses/LICENSE-2.0## Unless required by applicable law or agreed to in writing, software# distributed under the License is distributed on an "AS IS" BASIS,# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.# See the License for the specific language governing permissions and# limitations under the License.#package Apache2::Const;use ModPerl::Const ();use XSLoader ();our $VERSION = do { require mod_perl2; $mod_perl2::VERSION };our @ISA = qw(ModPerl::Const);XSLoader::load(__PACKAGE__, $VERSION);1;=head1 NAMEApache2::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 DescriptionThis package contains constants specific to C<Apache> features.mod_perl 2.0 comes with several hundreds of constants, which you don'twant to make available to your Perl code by default, due to CPU andmemory overhead. Therefore when you want to use a certain constant youneed to explicitly ask to make it available.For example, the code: use Apache2::Const -compile => qw(FORBIDDEN OK);makes the constants C<Apache2::Const::FORBIDDEN> and C<Apache2::Const::OK> availableto your code, but they aren't imported. In which case you need to usea 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 beused standalone like so: return OK;Both, due to the extra memory requirement, when importing symbols, andsince there are constants in other namespaces (e.g.,C<L<APR::|docs::2.0::api::APR::Const>> andC<L<ModPerl::|docs::2.0::api::ModPerl::Const>>, and non-mod_perlmodules) which may contain the same names, it's not recommended toimport constants. I.e. you want to use the C<-compile> construct.Finaly, in Perl C<=E<gt>> is almost the same as the comma operator. Itcan be used as syntax sugar making it more clear when there is akey-value relation between two arguments, and also it automaticallyparses its lefthand argument (the key) as a string, so you don't needto 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 inC<L<Apache2::Module::add()|docs::2.0::api::Apache2::Module/C_add_>>andC<L<$cmds-E<gt>args_how|docs::2.0::api::Apache2::Command/C_args_how_>>.=head3 C<Apache2::Const::FLAG>One of I<On> or I<Off> (L<fulldescription|docs::2.0::user::config::custom/C_Apache2__FLAG_>).=over=item since: 2.0.00=back=head3 C<Apache2::Const::ITERATE>One argument, occuring multiple times (L<fulldescription|docs::2.0::user::config::custom/C_Apache2__ITERATE_>).=over=item since: 2.0.00=back=head3 C<Apache2::Const::ITERATE2>Two arguments, the second occurs multiple times (L<fulldescription|docs::2.0::user::config::custom/C_Apache2__ITERATE2_>).=over=item since: 2.0.00=back=head3 C<Apache2::Const::NO_ARGS>No arguments at all (L<fulldescription|docs::2.0::user::config::custom/C__C_Apache2__NO_ARGS_>).=over=item since: 2.0.00=back=head3 C<Apache2::Const::RAW_ARGS>The command will parse the command line itself (L<fulldescription|docs::2.0::user::config::custom/C_Apache2__RAW_ARGS_>).=over=item since: 2.0.00=back=head3 C<Apache2::Const::TAKE1>One argument only (L<fulldescription|docs::2.0::user::config::custom/C_Apache2__TAKE1_>).=over=item since: 2.0.00=back=head3 C<Apache2::Const::TAKE12>One or two arguments (L<fulldescription|docs::2.0::user::config::custom/C_Apache2__TAKE12_>).=over=item since: 2.0.00=back=head3 C<Apache2::Const::TAKE123>One, two or three arguments (L<fulldescription|docs::2.0::user::config::custom/C_Apache2__TAKE123_>).=over=item since: 2.0.00=back=head3 C<Apache2::Const::TAKE13>One or three arguments (L<fulldescription|docs::2.0::user::config::custom/C_Apache2__TAKE13_>).=over=item since: 2.0.00=back=head3 C<Apache2::Const::TAKE2>Two arguments (L<fulldescription|docs::2.0::user::config::custom/C_Apache2__TAKE2_>).=over=item since: 2.0.00=back=head3 C<Apache2::Const::TAKE23>Two or three arguments (L<fulldescription|docs::2.0::user::config::custom/C_Apache2__TAKE23_>).=over=item since: 2.0.00=back=head3 C<Apache2::Const::TAKE3>Three arguments (L<fulldescription|docs::2.0::user::config::custom/C_Apache2__TAKE3_>).=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<Apache2::Const::AUTH_REQUIRED>=over=item since: 2.0.00=back=head3 C<Apache2::Const::DECLINED>=over=item since: 2.0.00=back=head3 C<Apache2::Const::DONE>=over=item since: 2.0.00=back=head3 C<Apache2::Const::FORBIDDEN>=over=item since: 2.0.00=back=head3 C<Apache2::Const::NOT_FOUND>=over=item since: 2.0.00=back=head3 C<Apache2::Const::OK>=over=item since: 2.0.00=back=head3 C<Apache2::Const::REDIRECT>=over=item since: 2.0.00=back=head3 C<Apache2::Const::SERVER_ERROR>=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<Apache2::Const::DECLINE_CMD>=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(C<L<$c-E<gt>keepalive|docs::2.0::api::Apache2::Connection/C_keepalive_>>)method.=head3 C<Apache2::Const::CONN_CLOSE>The connection will be closed at the end of the current HTTP request.=over=item since: 2.0.00=back=head3 C<Apache2::Const::CONN_KEEPALIVE>The connection will be kept alive at the end of the current HTTP request.=over=item since: 2.0.00=back=head3 C<Apache2::Const::CONN_UNKNOWN>The connection is at an unknown state, e.g., initialized but not openyet.=over=item since: 2.0.00=back=head2 C<:context> use Apache2::Const -compile => qw(:context);The C<:context> group is used by theC<L<$parms-E<gt>check_cmd_context|docs::2.0::api::Apache2::CmdParms/C_check_cmd_context_>>method.=head3 C<Apache2::Const::NOT_IN_VIRTUALHOST>The command is not in a E<lt>VirtualHostE<gt> block.=over=item since: 2.0.00=back=head3 C<Apache2::Const::NOT_IN_LIMIT>The command is not in a E<lt>LimitE<gt> block.=over=item since: 2.0.00=back=head3 C<Apache2::Const::NOT_IN_DIRECTORY>The command is not in a E<lt>DirectoryE<gt> block.=over=item since: 2.0.00=back=head3 C<Apache2::Const::NOT_IN_LOCATION>The command is not in a E<lt>LocationE<gt>/E<lt>LocationMatchE<gt> block.=over=item since: 2.0.00=back=head3 C<Apache2::Const::NOT_IN_FILES>The command is not in a E<lt>FilesE<gt>/E<lt>FilesMatchE<gt> block.=over=item since: 2.0.00=back=head3 C<Apache2::Const::NOT_IN_DIR_LOC_FILE>The command is not in a E<lt>FilesE<gt>/E<lt>FilesMatchE<gt>, E<lt>LocationE<gt>/E<lt>LocationMatchE<gt> or E<lt>DirectoryE<gt> block.=over=item since: 2.0.00=back=head3 C<Apache2::Const::GLOBAL_ONLY>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<Apache2::Const::FTYPE_CONNECTION>=over=item since: 2.0.00=back=head3 C<Apache2::Const::FTYPE_CONTENT_SET>=over=item since: 2.0.00=back=head3 C<Apache2::Const::FTYPE_NETWORK>=over=item since: 2.0.00=back=head3 C<Apache2::Const::FTYPE_PROTOCOL>=over=item since: 2.0.00=back=head3 C<Apache2::Const::FTYPE_RESOURCE>=over=item since: 2.0.00=back=head3 C<Apache2::Const::FTYPE_TRANSCODE>=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<Apache2::Const::HTTP_ACCEPTED>=over=item since: 2.0.00=back=head3 C<Apache2::Const::HTTP_BAD_GATEWAY>=over=item since: 2.0.00=back=head3 C<Apache2::Const::HTTP_BAD_REQUEST>=over=item since: 2.0.00=back=head3 C<Apache2::Const::HTTP_CONFLICT>=over=item since: 2.0.00=back=head3 C<Apache2::Const::HTTP_CONTINUE>=over=item since: 2.0.00=back=head3 C<Apache2::Const::HTTP_CREATED>=over=item since: 2.0.00=back=head3 C<Apache2::Const::HTTP_EXPECTATION_FAILED>=over=item since: 2.0.00=back=head3 C<Apache2::Const::HTTP_FAILED_DEPENDENCY>=over=item since: 2.0.00=back=head3 C<Apache2::Const::HTTP_FORBIDDEN>=over=item since: 2.0.00=back=head3 C<Apache2::Const::HTTP_GATEWAY_TIME_OUT>=over=item since: 2.0.00=back=head3 C<Apache2::Const::HTTP_GONE>=over=item since: 2.0.00=back=head3 C<Apache2::Const::HTTP_INSUFFICIENT_STORAGE>=over=item since: 2.0.00=back=head3 C<Apache2::Const::HTTP_INTERNAL_SERVER_ERROR>=over=item since: 2.0.00=back=head3 C<Apache2::Const::HTTP_LENGTH_REQUIRED>=over=item since: 2.0.00=back=head3 C<Apache2::Const::HTTP_LOCKED>=over=item since: 2.0.00=back=head3 C<Apache2::Const::HTTP_METHOD_NOT_ALLOWED>=over=item since: 2.0.00=back=head3 C<Apache2::Const::HTTP_MOVED_PERMANENTLY>=over=item since: 2.0.00=back=head3 C<Apache2::Const::HTTP_MOVED_TEMPORARILY>=over=item since: 2.0.00=back=head3 C<Apache2::Const::HTTP_MULTIPLE_CHOICES>=over=item since: 2.0.00=back=head3 C<Apache2::Const::HTTP_MULTI_STATUS>=over=item since: 2.0.00=back=head3 C<Apache2::Const::HTTP_NON_AUTHORITATIVE>=over=item since: 2.0.00=back=head3 C<Apache2::Const::HTTP_NOT_ACCEPTABLE>=over=item since: 2.0.00=back=head3 C<Apache2::Const::HTTP_NOT_EXTENDED>=over=item since: 2.0.00=back=head3 C<Apache2::Const::HTTP_NOT_FOUND>=over=item since: 2.0.00=back=head3 C<Apache2::Const::HTTP_NOT_IMPLEMENTED>=over=item since: 2.0.00=back=head3 C<Apache2::Const::HTTP_NOT_MODIFIED>=over=item since: 2.0.00=back=head3 C<Apache2::Const::HTTP_NO_CONTENT>=over=item since: 2.0.00=back=head3 C<Apache2::Const::HTTP_OK>=over=item since: 2.0.00=back=head3 C<Apache2::Const::HTTP_PARTIAL_CONTENT>=over=item since: 2.0.00=back=head3 C<Apache2::Const::HTTP_PAYMENT_REQUIRED>=over=item since: 2.0.00=back=head3 C<Apache2::Const::HTTP_PRECONDITION_FAILED>=over=item since: 2.0.00=back=head3 C<Apache2::Const::HTTP_PROCESSING>=over=item since: 2.0.00=back=head3 C<Apache2::Const::HTTP_PROXY_AUTHENTICATION_REQUIRED>=over=item since: 2.0.00=back=head3 C<Apache2::Const::HTTP_RANGE_NOT_SATISFIABLE>=over=item since: 2.0.00=back=head3 C<Apache2::Const::HTTP_REQUEST_ENTITY_TOO_LARGE>=over=item since: 2.0.00=back=head3 C<Apache2::Const::HTTP_REQUEST_TIME_OUT>=over=item since: 2.0.00=back=head3 C<Apache2::Const::HTTP_REQUEST_URI_TOO_LARGE>=over=item since: 2.0.00=back=head3 C<Apache2::Const::HTTP_RESET_CONTENT>=over=item since: 2.0.00=back=head3 C<Apache2::Const::HTTP_SEE_OTHER>=over=item since: 2.0.00=back=head3 C<Apache2::Const::HTTP_SERVICE_UNAVAILABLE>=over=item since: 2.0.00=back=head3 C<Apache2::Const::HTTP_SWITCHING_PROTOCOLS>=over=item since: 2.0.00=back=head3 C<Apache2::Const::HTTP_TEMPORARY_REDIRECT>=over=item since: 2.0.00=back=head3 C<Apache2::Const::HTTP_UNAUTHORIZED>=over=item since: 2.0.00=back=head3 C<Apache2::Const::HTTP_UNPROCESSABLE_ENTITY>=over=item since: 2.0.00=back=head3 C<Apache2::Const::HTTP_UNSUPPORTED_MEDIA_TYPE>=over=item since: 2.0.00=back=head3 C<Apache2::Const::HTTP_UPGRADE_REQUIRED>=over=item since: 2.0.00=back=head3 C<Apache2::Const::HTTP_USE_PROXY>=over=item since: 2.0.00=back=head3 C<Apache2::Const::HTTP_VARIANT_ALSO_VARIES>=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 byC<L<get_brigade|docs::2.0::api::Apache2::Filter/C_get_brigade_>>.=head3 C<Apache2::Const::MODE_EATCRLF>=over=item since: 2.0.00=backSeeC<L<Apache2::Filter::get_brigade()|docs::2.0::api::Apache2::Filter/C_get_brigade_>>.=head3 C<Apache2::Const::MODE_EXHAUSTIVE>=over=item since: 2.0.00
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -