.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 .\" .\" Standard preamble: .\" ======================================================================== .de Sh \" Subsection heading .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. | will give a .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to .\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' .\" expand to `' in nroff, nothing in troff, for use with C<>. .tr \(*W-|\(bv\*(Tr .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .\" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .hy 0 .if n .na .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Constants 3" .TH Constants 3 "2007-03-30" "perl v5.8.8" "User Contributed Perl Documentation" .SH "NAME" Apache::Constants \- Constants defined in apache header files .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 3 \& use Apache::Constants; \& use Apache::Constants ':common'; \& use Apache::Constants ':response'; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Server constants used by apache modules are defined in \&\fBhttpd.h\fR and other header files, this module gives Perl access to those constants. .SH "EXPORT TAGS" .IX Header "EXPORT TAGS" .IP "common" 4 .IX Item "common" This tag imports the most commonly used constants. .Sp .Vb 7 \& OK \& DECLINED \& DONE \& NOT_FOUND \& FORBIDDEN \& AUTH_REQUIRED \& SERVER_ERROR .Ve .IP "response" 4 .IX Item "response" This tag imports the \fBcommon\fR response codes, plus these response codes: .Sp .Vb 10 \& DOCUMENT_FOLLOWS \& MOVED \& REDIRECT \& USE_LOCAL_COPY \& BAD_REQUEST \& BAD_GATEWAY \& RESPONSE_CODES \& NOT_IMPLEMENTED \& CONTINUE \& NOT_AUTHORITATIVE .Ve .Sp \&\fB\s-1CONTINUE\s0\fR and \fB\s-1NOT_AUTHORITATIVE\s0\fR are aliases for \fB\s-1DECLINED\s0\fR. .IP "methods" 4 .IX Item "methods" This are the method numbers, commonly used with the Apache \fBmethod_number\fR method. .Sp .Vb 17 \& METHODS \& M_CONNECT \& M_DELETE \& M_GET \& M_INVALID \& M_OPTIONS \& M_POST \& M_PUT \& M_TRACE \& M_PATCH \& M_PROPFIND \& M_PROPPATCH \& M_MKCOL \& M_COPY \& M_MOVE \& M_LOCK \& M_UNLOCK .Ve .IP "options" 4 .IX Item "options" These constants are most commonly used with the Apache \fBallow_options\fR method: .Sp .Vb 10 \& OPT_NONE \& OPT_INDEXES \& OPT_INCLUDES \& OPT_SYM_LINKS \& OPT_EXECCGI \& OPT_UNSET \& OPT_INCNOEXEC \& OPT_SYM_OWNER \& OPT_MULTI \& OPT_ALL .Ve .IP "satisfy" 4 .IX Item "satisfy" These constants are most commonly used with the Apache \fBsatisfies\fR method: .Sp .Vb 3 \& SATISFY_ALL \& SATISFY_ANY \& SATISFY_NOSPEC .Ve .IP "remotehost" 4 .IX Item "remotehost" These constants are most commonly used with the Apache \fBget_remote_host\fR method: .Sp .Vb 4 \& REMOTE_HOST \& REMOTE_NAME \& REMOTE_NOLOOKUP \& REMOTE_DOUBLE_REV .Ve .IP "http" 4 .IX Item "http" This is the full set of \s-1HTTP\s0 response codes: (\s-1NOTE:\s0 not all implemented here) .Sp .Vb 15 \& HTTP_OK \& HTTP_MOVED_TEMPORARILY \& HTTP_MOVED_PERMANENTLY \& HTTP_METHOD_NOT_ALLOWED \& HTTP_NOT_MODIFIED \& HTTP_UNAUTHORIZED \& HTTP_FORBIDDEN \& HTTP_NOT_FOUND \& HTTP_BAD_REQUEST \& HTTP_INTERNAL_SERVER_ERROR \& HTTP_NOT_ACCEPTABLE \& HTTP_NO_CONTENT \& HTTP_PRECONDITION_FAILED \& HTTP_SERVICE_UNAVAILABLE \& HTTP_VARIANT_ALSO_VARIES .Ve .IP "server" 4 .IX Item "server" These are constants related to server version: .Sp .Vb 3 \& MODULE_MAGIC_NUMBER \& SERVER_VERSION \& SERVER_BUILT .Ve .IP "config" 4 .IX Item "config" These are constants related to configuration directives: .Sp .Vb 1 \& DECLINE_CMD .Ve .IP "types" 4 .IX Item "types" These are constants related to internal request types: .Sp .Vb 1 \& DIR_MAGIC_TYPE .Ve .IP "override" 4 .IX Item "override" These constants are used to control and test the context of configuration directives. .Sp .Vb 10 \& OR_NONE \& OR_LIMIT \& OR_OPTIONS \& OR_FILEINFO \& OR_AUTHCFG \& OR_INDEXES \& OR_UNSET \& OR_ALL \& ACCESS_CONF \& RSRC_CONF .Ve .IP "args_how" 4 .IX Item "args_how" .Vb 11 \& RAW_ARGS \& TAKE1 \& TAKE2 \& TAKE12 \& TAKE3 \& TAKE23 \& TAKE123 \& ITERATE \& ITERATE2 \& FLAG \& NO_ARGS .Ve .SH "Misuses" .IX Header "Misuses" You should be aware of the issues relating to using constant subroutines in Perl. For example this: .PP .Vb 1 \& $r->custom_response(FORBIDDEN => "File size exceeds quota."); .Ve .PP will not set a custom response for \f(CW\*(C`FORBIDDEN\*(C'\fR, but for the string \&\f(CW"FORBIDDEN"\fR, which clearly isn't what is expected. You'll get an error like this: .PP .Vb 2 \& [Tue Apr 23 19:46:14 2002] null: Argument "FORBIDDEN" isn't \& numeric in subroutine entry at ... .Ve .PP Therefore, the best solution is not to use the hash notation for things that don't require it: .PP .Vb 1 \& $r->custom_response(FORBIDDEN, "File size exceeds quota."); .Ve .PP Another important note is that instead of using \s-1HTTP\s0 codes, you should use designed for that purpose constants. Therefore, this is wrong: .PP .Vb 1 \& sub handler { return 200; } .Ve .PP The correct use is: .PP .Vb 2 \& use Apache::Constants qw(OK); \& sub handler { return OK; } .Ve .PP Also remember that \f(CW\*(C`OK != HTTP_OK\*(C'\fR. .SH "AUTHORS" .IX Header "AUTHORS" Doug MacEachern, Gisle Aas and h2xs