mod_perl logo perl icon
previous page: Apache2::ConnectionUtil - Perl API for Apache connection utilspage up: mod_perl 2.0 APInext page: Apache2::Directive - Perl API for manipulating the Apache configuration tree

Apache2::Const - Perl Interface for Apache Constants






mod_perl2 User's Guide

mod_perl2 User's Guide

By Stas Bekman, Jim Brandt
Practical mod_perl

Practical mod_perl

By Stas Bekman, Eric Cholet
The mod_perl Developer's Cookbook

The mod_perl Developer's Cookbook

By Geoffrey Young, Paul Lindner, Randy Kobes
mod_perl Pocket Reference

mod_perl Pocket Reference

By Andrew Ford
Writing Apache Modules with Perl and C

Writing Apache Modules with Perl and C

By Lincoln Stein, Doug MacEachern
Embedding Perl in HTML with Mason

Embedding Perl in HTML with Mason

By Dave Rolsky, Ken Williams


Table of Contents

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 ...);


TOP

Description

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));


TOP

Constants



TOP

:cmd_how

  use Apache2::Const -compile => qw(:cmd_how);

The :cmd_how constants group is used in Apache2::Module::add() and $cmds->args_how.



TOP

Apache2::Const::FLAG

One of On or Off (full description).



TOP

Apache2::Const::ITERATE

One argument, occuring multiple times (full description).



TOP

Apache2::Const::ITERATE2

Two arguments, the second occurs multiple times (full description).



TOP

Apache2::Const::NO_ARGS

No arguments at all (full description).



TOP

Apache2::Const::RAW_ARGS

The command will parse the command line itself (full description).



TOP

Apache2::Const::TAKE1

One argument only (full description).



TOP

Apache2::Const::TAKE12

One or two arguments (full description).



TOP

Apache2::Const::TAKE123

One, two or three arguments (full description).



TOP

Apache2::Const::TAKE13

One or three arguments (full description).



TOP

Apache2::Const::TAKE2

Two arguments (full description).



TOP

Apache2::Const::TAKE23

Two or three arguments (full description).



TOP

Apache2::Const::TAKE3

Three arguments (full description).



TOP

:common

  use Apache2::Const -compile => qw(:common);

The :common group is for XXX constants.



TOP

Apache2::Const::AUTH_REQUIRED



TOP

Apache2::Const::DECLINED



TOP

Apache2::Const::DONE



TOP

Apache2::Const::FORBIDDEN



TOP

Apache2::Const::NOT_FOUND



TOP

Apache2::Const::OK



TOP

Apache2::Const::REDIRECT



TOP

Apache2::Const::SERVER_ERROR



TOP

:config

  use Apache2::Const -compile => qw(:config);

The :config group is for XXX constants.



TOP

Apache2::Const::DECLINE_CMD



TOP

:conn_keepalive

  use Apache2::Const -compile => qw(:conn_keepalive);

The :conn_keepalive constants group is used by the ($c->keepalive) method.



TOP

Apache2::Const::CONN_CLOSE

The connection will be closed at the end of the current HTTP request.



TOP

Apache2::Const::CONN_KEEPALIVE

The connection will be kept alive at the end of the current HTTP request.



TOP

Apache2::Const::CONN_UNKNOWN

The connection is at an unknown state, e.g., initialized but not open yet.



TOP

:context

  use Apache2::Const -compile => qw(:context);

The :context group is used by the $parms->check_cmd_context method.



TOP

Apache2::Const::NOT_IN_VIRTUALHOST

The command is not in a <VirtualHost> block.



TOP

Apache2::Const::NOT_IN_LIMIT

The command is not in a <Limit> block.



TOP

Apache2::Const::NOT_IN_DIRECTORY

The command is not in a <Directory> block.



TOP

Apache2::Const::NOT_IN_LOCATION

The command is not in a <Location>/<LocationMatch> block.



TOP

Apache2::Const::NOT_IN_FILES

The command is not in a <Files>/<FilesMatch> block.



TOP

Apache2::Const::NOT_IN_DIR_LOC_FILE

The command is not in a <Files>/<FilesMatch>, <Location>/<LocationMatch> or <Directory> block.



TOP

Apache2::Const::GLOBAL_ONLY

The directive appears outside of any container directives.



TOP

:filter_type

  use Apache2::Const -compile => qw(:filter_type);

The :filter_type group is for XXX constants.



TOP

Apache2::Const::FTYPE_CONNECTION



TOP

Apache2::Const::FTYPE_CONTENT_SET



TOP

Apache2::Const::FTYPE_NETWORK



TOP

Apache2::Const::FTYPE_PROTOCOL



TOP

Apache2::Const::FTYPE_RESOURCE



TOP

Apache2::Const::FTYPE_TRANSCODE



TOP

:http

  use Apache2::Const -compile => qw(:http);

The :http group is for XXX constants.



TOP

Apache2::Const::HTTP_ACCEPTED



TOP

Apache2::Const::HTTP_BAD_GATEWAY



TOP

Apache2::Const::HTTP_BAD_REQUEST



TOP

Apache2::Const::HTTP_CONFLICT



TOP

Apache2::Const::HTTP_CONTINUE



TOP

Apache2::Const::HTTP_CREATED



TOP

Apache2::Const::HTTP_EXPECTATION_FAILED



TOP

Apache2::Const::HTTP_FAILED_DEPENDENCY



TOP

Apache2::Const::HTTP_FORBIDDEN



TOP

Apache2::Const::HTTP_GATEWAY_TIME_OUT



TOP

Apache2::Const::HTTP_GONE



TOP

Apache2::Const::HTTP_INSUFFICIENT_STORAGE



TOP

Apache2::Const::HTTP_INTERNAL_SERVER_ERROR



TOP

Apache2::Const::HTTP_LENGTH_REQUIRED



TOP

Apache2::Const::HTTP_LOCKED



TOP

Apache2::Const::HTTP_METHOD_NOT_ALLOWED



TOP

Apache2::Const::HTTP_MOVED_PERMANENTLY



TOP

Apache2::Const::HTTP_MOVED_TEMPORARILY



TOP

Apache2::Const::HTTP_MULTIPLE_CHOICES



TOP

Apache2::Const::HTTP_MULTI_STATUS



TOP

Apache2::Const::HTTP_NON_AUTHORITATIVE



TOP

Apache2::Const::HTTP_NOT_ACCEPTABLE



TOP

Apache2::Const::HTTP_NOT_EXTENDED



TOP

Apache2::Const::HTTP_NOT_FOUND



TOP

Apache2::Const::HTTP_NOT_IMPLEMENTED



TOP

Apache2::Const::HTTP_NOT_MODIFIED



TOP

Apache2::Const::HTTP_NO_CONTENT



TOP

Apache2::Const::HTTP_OK



TOP

Apache2::Const::HTTP_PARTIAL_CONTENT



TOP

Apache2::Const::HTTP_PAYMENT_REQUIRED



TOP

Apache2::Const::HTTP_PRECONDITION_FAILED



TOP

Apache2::Const::HTTP_PROCESSING



TOP

Apache2::Const::HTTP_PROXY_AUTHENTICATION_REQUIRED



TOP

Apache2::Const::HTTP_RANGE_NOT_SATISFIABLE



TOP

Apache2::Const::HTTP_REQUEST_ENTITY_TOO_LARGE



TOP

Apache2::Const::HTTP_REQUEST_TIME_OUT



TOP

Apache2::Const::HTTP_REQUEST_URI_TOO_LARGE



TOP

Apache2::Const::HTTP_RESET_CONTENT



TOP

Apache2::Const::HTTP_SEE_OTHER



TOP

Apache2::Const::HTTP_SERVICE_UNAVAILABLE



TOP

Apache2::Const::HTTP_SWITCHING_PROTOCOLS



TOP

Apache2::Const::HTTP_TEMPORARY_REDIRECT



TOP

Apache2::Const::HTTP_UNAUTHORIZED



TOP

Apache2::Const::HTTP_UNPROCESSABLE_ENTITY



TOP

Apache2::Const::HTTP_UNSUPPORTED_MEDIA_TYPE



TOP

Apache2::Const::HTTP_UPGRADE_REQUIRED



TOP

Apache2::Const::HTTP_USE_PROXY



TOP

Apache2::Const::HTTP_VARIANT_ALSO_VARIES



TOP

:input_mode

  use Apache2::Const -compile => qw(:input_mode);

The :input_mode group is used by get_brigade.



TOP

Apache2::Const::MODE_EATCRLF

See Apache2::Filter::get_brigade().



TOP

Apache2::Const::MODE_EXHAUSTIVE

See Apache2::Filter::get_brigade().



TOP

Apache2::Const::MODE_GETLINE

See Apache2::Filter::get_brigade().



TOP

Apache2::Const::MODE_INIT

See Apache2::Filter::get_brigade().



TOP

Apache2::Const::MODE_READBYTES

See Apache2::Filter::get_brigade().



TOP

Apache2::Const::MODE_SPECULATIVE

See Apache2::Filter::get_brigade().



TOP

:log

  use Apache2::Const -compile => qw(:log);

The :log group is for constants used by Apache2::Log.



TOP

Apache2::Const::LOG_ALERT

See Apache2::Log.



TOP

Apache2::Const::LOG_CRIT

See Apache2::Log.



TOP

Apache2::Const::LOG_DEBUG

See Apache2::Log.



TOP

Apache2::Const::LOG_EMERG

See Apache2::Log.



TOP

Apache2::Const::LOG_ERR

See Apache2::Log.



TOP

Apache2::Const::LOG_INFO

See Apache2::Log.



TOP

Apache2::Const::LOG_LEVELMASK

See Apache2::Log.



TOP

Apache2::Const::LOG_NOTICE

See Apache2::Log.



TOP

Apache2::Const::LOG_STARTUP

See Apache2::Log.



TOP

Apache2::Const::LOG_TOCLIENT

See Apache2::Log.



TOP

Apache2::Const::LOG_WARNING

See Apache2::Log.



TOP

:methods

  use Apache2::Const -compile => qw(:methods);

The :methods constants group is used in conjunction with $r->method_number.



TOP

Apache2::Const::METHODS



TOP

Apache2::Const::M_BASELINE_CONTROL



TOP

Apache2::Const::M_CHECKIN



TOP

Apache2::Const::M_CHECKOUT



TOP

Apache2::Const::M_CONNECT



TOP

Apache2::Const::M_COPY



TOP

Apache2::Const::M_DELETE



TOP

Apache2::Const::M_GET

corresponds to the HTTP GET method



TOP

Apache2::Const::M_INVALID



TOP

Apache2::Const::M_LABEL



TOP

Apache2::Const::M_LOCK



TOP

Apache2::Const::M_MERGE



TOP

Apache2::Const::M_MKACTIVITY



TOP

Apache2::Const::M_MKCOL



TOP

Apache2::Const::M_MKWORKSPACE



TOP

Apache2::Const::M_MOVE



TOP

Apache2::Const::M_OPTIONS



TOP

Apache2::Const::M_PATCH



TOP

Apache2::Const::M_POST

corresponds to the HTTP POST method



TOP

Apache2::Const::M_PROPFIND



TOP

Apache2::Const::M_PROPPATCH



TOP

Apache2::Const::M_PUT

corresponds to the HTTP PUT method



TOP

Apache2::Const::M_REPORT



TOP

Apache2::Const::M_TRACE



TOP

Apache2::Const::M_UNCHECKOUT



TOP

Apache2::Const::M_UNLOCK



TOP

Apache2::Const::M_UPDATE



TOP

Apache2::Const::M_VERSION_CONTROL



TOP

:mpmq

  use Apache2::Const -compile => qw(:mpmq);

The :mpmq group is for querying MPM properties.



TOP

Apache2::Const::MPMQ_NOT_SUPPORTED



TOP

Apache2::Const::MPMQ_STATIC



TOP

Apache2::Const::MPMQ_DYNAMIC



TOP

Apache2::Const::MPMQ_MAX_DAEMON_USED



TOP

Apache2::Const::MPMQ_IS_THREADED



TOP

Apache2::Const::MPMQ_IS_FORKED



TOP

Apache2::Const::MPMQ_HARD_LIMIT_DAEMONS



TOP

Apache2::Const::MPMQ_HARD_LIMIT_THREADS



TOP

Apache2::Const::MPMQ_MAX_THREADS



TOP

Apache2::Const::MPMQ_MIN_SPARE_DAEMONS



TOP

Apache2::Const::MPMQ_MIN_SPARE_THREADS



TOP

Apache2::Const::MPMQ_MAX_SPARE_DAEMONS



TOP

Apache2::Const::MPMQ_MAX_SPARE_THREADS



TOP

Apache2::Const::MPMQ_MAX_REQUESTS_DAEMON



TOP

Apache2::Const::MPMQ_MAX_DAEMONS



TOP

:options

  use Apache2::Const -compile => qw(:options);

The :options group contains constants corresponding to the Options configuration directive. For examples see: $r->allow_options.



TOP

Apache2::Const::OPT_ALL



TOP

Apache2::Const::OPT_EXECCGI



TOP

Apache2::Const::OPT_INCLUDES



TOP

Apache2::Const::OPT_INCNOEXEC



TOP

Apache2::Const::OPT_INDEXES



TOP

Apache2::Const::OPT_MULTI



TOP

Apache2::Const::OPT_NONE



TOP

Apache2::Const::OPT_SYM_LINKS



TOP

Apache2::Const::OPT_SYM_OWNER



TOP

Apache2::Const::OPT_UNSET



TOP

:override

  use Apache2::Const -compile => qw(:override);

The :override group contains constants corresponding to the AllowOverride configuration directive. For examples see: $r->allow_options.



TOP

Apache2::Const::ACCESS_CONF

*.conf inside <Directory> or <Location>



TOP

Apache2::Const::EXEC_ON_READ

Force directive to execute a command which would modify the configuration (like including another file, or IFModule)



TOP

Apache2::Const::OR_ALL

Apache2::Const::OR_LIMIT | Apache2::Const::OR_OPTIONS | Apache2::Const::OR_FILEINFO | Apache2::Const::OR_AUTHCFG | Apache2::Const::OR_INDEXES



TOP

Apache2::Const::OR_AUTHCFG

*.conf inside <Directory> or <Location> and .htaccess when AllowOverride AuthConfig



TOP

Apache2::Const::OR_FILEINFO

*.conf anywhere and .htaccess when AllowOverride FileInfo



TOP

Apache2::Const::OR_INDEXES

*.conf anywhere and .htaccess when AllowOverride Indexes



TOP

Apache2::Const::OR_LIMIT

*.conf inside <Directory> or <Location> and .htaccess when AllowOverride Limit



TOP

Apache2::Const::OR_NONE

*.conf is not available anywhere in this override



TOP

Apache2::Const::OR_OPTIONS

*.conf anywhere and .htaccess when AllowOverride Options



TOP

Apache2::Const::OR_UNSET

Unset a directive (in Allow)



TOP

Apache2::Const::RSRC_CONF

*.conf outside <Directory> or <Location>



TOP

:platform

  use Apache2::Const -compile => qw(:platform);

The :platform group is for constants that may differ from OS to OS.



TOP

Apache2::Const::CRLF



TOP

Apache2::Const::CR



TOP

Apache2::Const::LF



TOP

:remotehost

  use Apache2::Const -compile => qw(:remotehost);

The :remotehost constants group is is used by the $c->get_remote_host method.



TOP

Apache2::Const::REMOTE_DOUBLE_REV



TOP

Apache2::Const::REMOTE_HOST



TOP

Apache2::Const::REMOTE_NAME



TOP

Apache2::Const::REMOTE_NOLOOKUP



TOP

:satisfy

  use Apache2::Const -compile => qw(:satisfy);

The :satisfy constants group is used in conjunction with $r->satisfies.



TOP

Apache2::Const::SATISFY_ALL

All of the requirements must be met.



TOP

Apache2::Const::SATISFY_ANY

any of the requirements must be met.



TOP

Apache2::Const::SATISFY_NOSPEC

There are no applicable satisfy lines



TOP

:types

  use Apache2::Const -compile => qw(:types);

The :types group is for XXX constants.



TOP

Apache2::Const::DIR_MAGIC_TYPE



TOP

:proxy

  use Apache2::Const -compile => qw(:proxy);

The :proxy constants group is used in conjunction with $r->proxyreq.



TOP

Apache2::Const::PROXYREQ_NONE



TOP

Apache2::Const::PROXYREQ_PROXY



TOP

Apache2::Const::PROXYREQ_REVERSE



TOP

Apache2::Const::PROXYREQ_RESPONSE



TOP

See Also

mod_perl 2.0 documentation.

HTTP Status Codes.



TOP

Copyright

mod_perl 2.0 and its core modules are copyrighted under The Apache Software License, Version 2.0.



TOP

Authors

The mod_perl development team and numerous contributors.






TOP
previous page: Apache2::ConnectionUtil - Perl API for Apache connection utilspage up: mod_perl 2.0 APInext page: Apache2::Directive - Perl API for manipulating the Apache configuration tree