home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / xampp / xampp-perl-addon-1.4.9-installer.exe / CmdParms.pm < prev    next >
Encoding:
Perl POD Document  |  2004-09-23  |  8.1 KB  |  447 lines

  1. # /*
  2. #  * *********** WARNING **************
  3. #  * This file generated by ModPerl::WrapXS/0.01
  4. #  * Any changes made here will be lost
  5. #  * ***********************************
  6. #  * 01: lib/ModPerl/Code.pm:701
  7. #  * 02: O:\147xampp\sources\mod_perl-1.99_16\blib\lib/ModPerl/WrapXS.pm:584
  8. #  * 03: O:\147xampp\sources\mod_perl-1.99_16\blib\lib/ModPerl/WrapXS.pm:1100
  9. #  * 04: Makefile.PL:335
  10. #  * 05: Makefile.PL:283
  11. #  * 06: Makefile.PL:51
  12. #  */
  13.  
  14.  
  15. package Apache::CmdParms;
  16.  
  17. use strict;
  18. use warnings FATAL => 'all';
  19.  
  20.  
  21.  
  22. use Apache::XSLoader ();
  23. our $VERSION = '0.01';
  24. Apache::XSLoader::load __PACKAGE__;
  25.  
  26.  
  27.  
  28. 1;
  29. __END__
  30.  
  31. =head1 NAME
  32.  
  33. Apache::CmdParms - Perl API for Apache command parameters object
  34.  
  35.  
  36.  
  37.  
  38. =head1 Synopsis
  39.  
  40.   use Apache::CmdParms ();
  41.   use Apache::Const -compile => qw(NOT_IN_LOCATION);
  42.   
  43.   sub MyDirective {
  44.       my($self, $parms, $args) = @_;
  45.       
  46.       # this command's command object
  47.       $cmd = $parms->cmd;
  48.       
  49.       # check the current command's context
  50.       $error = $parms->check_cmd_context(Apache::NOT_IN_LOCATION);
  51.       
  52.       # this command's context
  53.       $context = $parms->context;
  54.       
  55.       # this command's directive object
  56.       $directive = $parms->directive;
  57.       
  58.       # the extra information passed thru cmd_data in
  59.       # @APACHE_MODULE_COMMANDS
  60.       $info = $parms->info;
  61.       
  62.       # which methods are <Limit>ed ?
  63.       $is_limited = $parms->method_is_limited('GET');
  64.       
  65.       # which allow-override bits are set
  66.       $override = $parms->override;
  67.       
  68.       # the path this command is being invoked in
  69.       $path = $parms->path;
  70.       
  71.       # this command's pool
  72.       $p = $parms->pool;
  73.       
  74.       # this command's configuration time pool
  75.       $p = $parms->temp_pool;
  76.   }
  77.  
  78.  
  79.  
  80.  
  81.  
  82. =head1 Description
  83.  
  84. C<Apache::CmdParms> provides the Perl API for Apache command
  85. parameters object.
  86.  
  87.  
  88.  
  89.  
  90. =head1 API
  91.  
  92. C<Apache::CmdParms> provides the following functions and/or methods:
  93.  
  94.  
  95.  
  96.  
  97.  
  98. =head2 C<cmd>
  99.  
  100. This module's command information
  101.  
  102.   $cmd = $parms->cmd();
  103.  
  104. =over 4
  105.  
  106. =item obj: C<$parms>
  107. ( C<L<Apache::CmdParms object|docs::2.0::api::Apache::CmdParms>> )
  108.  
  109. =item ret: C<$cmd>
  110. ( C<L<Apache::Command object|docs::2.0::api::Apache::Command>> )
  111.  
  112. =item since: 1.99_12
  113.  
  114. =back
  115.  
  116.  
  117.  
  118.  
  119.  
  120. =head2 C<check_cmd_context>
  121.  
  122. Check the current command against a context bitmask of forbidden contexts.
  123.  
  124.   $error = $parms->check_cmd_context($check);
  125.  
  126. =over 4
  127.  
  128. =item obj: C<$parms>
  129. ( C<L<Apache::CmdParms object|docs::2.0::api::Apache::CmdParms>> )
  130.  
  131. =item arg1: C<$check> ( C<L<Apache::Const :context
  132. constant|docs::2.0::api::Apache::Const/C__context_>> )
  133.  
  134. the context to check against.
  135.  
  136. =item ret: C<$error> ( string / undef )
  137.  
  138. If the context is forbidden, this method returns a textual description
  139. of why it was forbidden. If the context is permitted, this method returns
  140. C<undef>.
  141.  
  142. =item since: 1.99_15
  143.  
  144. =back
  145.  
  146. For example here is how to check whether a command is allowed in the
  147. E<lt>LocationE<gt> container:
  148.  
  149.   use Apache::Const -compile qw(NOT_IN_LOCATION);
  150.   if (my $error = $parms->check_cmd_context(Apache::NOT_IN_LOCATION)) {
  151.       die "directive ... not allowed in <Location> context"
  152.   }
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161. =head2 C<directive>
  162.  
  163. This command's directive object in the configuration tree
  164.  
  165.   $directive = $parms->directive;
  166.  
  167. =over 4
  168.  
  169. =item obj: C<$parms>
  170. ( C<L<Apache::CmdParms object|docs::2.0::api::Apache::CmdParms>> )
  171.  
  172. =item ret: C<$newval>
  173. ( C<L<Apache::Directive object|docs::2.0::api::Apache::Directive>> )
  174.  
  175. The current directive node in the configuration tree
  176.  
  177. =item since: 1.99_12
  178.  
  179. =back
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186. =head2 C<info>
  187.  
  188. The extra information passed thru C<cmd_data> in
  189. C<L<@APACHE_MODULE_COMMANDS|docs::2.0::user::config::custom/C_cmd_data_>>
  190.  
  191.   $info = $parms->info;
  192.  
  193. =over 4
  194.  
  195. =item obj: C<$parms>
  196. ( C<L<Apache::CmdParms object|docs::2.0::api::Apache::CmdParms>> )
  197.  
  198. =item ret: C<$info> ( string )
  199.  
  200. The string passed in C<cmd_data>
  201.  
  202. =item since: 1.99_12
  203.  
  204. =back
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211. =head2 C<method_is_limited>
  212.  
  213. Discover if a method is E<lt>LimitE<gt>ed in the current scope
  214.  
  215.   $is_limited = $parms->method_is_limited($method);
  216.  
  217. =over 4
  218.  
  219. =item obj: C<$parms>
  220. ( C<L<Apache::CmdParms object|docs::2.0::api::Apache::CmdParms>> )
  221.  
  222. =item arg1: C<$method> (string)
  223.  
  224. The name of the method to check for
  225.  
  226. =item ret: C<$is_limited> ( boolean )
  227.  
  228. =item since: 1.99_15
  229.  
  230. =back
  231.  
  232. For example, to check if the C<GET> method is being E<lt>LimitE<gt>ed
  233. in the current scope, do:
  234.  
  235.   if ($parms->method_is_limited('GET') {
  236.       die "...";
  237.   }
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245. =head2 C<override>
  246.  
  247. Which allow-override bits are set (C<AllowOverride> directive)
  248.  
  249.   $override = $parms->override;
  250.  
  251. =over 4
  252.  
  253. =item obj: C<$parms>
  254. ( C<L<Apache::CmdParms object|docs::2.0::api::Apache::CmdParms>> )
  255.  
  256. =item ret: C<$override> ( bitmask )
  257.  
  258. the allow-override bits bitmask, which can be tested against
  259. C<L<Apache::Const :override
  260. constants|docs::2.0::api::Apache::Const/C__override_>>.
  261.  
  262. =item since: 1.99_12
  263.  
  264. =back
  265.  
  266. For example to check that the C<AllowOverride>'s C<AuthConfig> and
  267. C<FileInfo> options are enabled for this command, do:
  268.  
  269.   use Apache::Const -compile qw(:override);
  270.   $wanted = Apache::OR_AUTHCFG | Apache::OR_FILEINFO;
  271.   $masked = $parms->override & $wanted;
  272.   unless ($wanted == $masked) {
  273.       die "...";
  274.   }
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282. =head2 C<path>
  283.  
  284. The current pathname/location/match of the block this command is in
  285.  
  286.   $path = $parms->path;
  287.  
  288. =over 4
  289.  
  290. =item obj: C<$parms>
  291. ( C<L<Apache::CmdParms object|docs::2.0::api::Apache::CmdParms>> )
  292.  
  293. =item ret: C<$path> ( string / undef )
  294.  
  295. If configuring for a block like E<lt>LocationE<gt>,
  296. E<lt>LocationMatchE<gt>, E<lt>DirectoryE<gt>, etc., the pathname part
  297. of that directive. Otherwise, C<undef> is returned.
  298.  
  299. =item since: 1.99_12
  300.  
  301. =back
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309. =head2 C<pool>
  310.  
  311. Pool associated with this command
  312.  
  313.   $p = $parms->pool;
  314.  
  315. =over 4
  316.  
  317. =item obj: C<$parms>
  318. ( C<L<Apache::CmdParms object|docs::2.0::api::Apache::CmdParms>> )
  319.  
  320. =item ret: C<$p>
  321. ( C<L<APR::Pool object|docs::2.0::api::APR::Pool>> )
  322.  
  323. =item since: 1.99_12
  324.  
  325. =back
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332. =head2 C<server>
  333.  
  334. The server this command is appearing in
  335.  
  336.   $s = $parms->server;
  337.  
  338. =over 4
  339.  
  340. =item obj: C<$parms>
  341. ( C<L<Apache::CmdParms object|docs::2.0::api::Apache::CmdParms>> )
  342.  
  343. =item ret: C<$s>
  344. ( C<L<Apache::Server object|docs::2.0::api::Apache::ServerRec>> )
  345.  
  346. =item since: 1.99_12
  347.  
  348. =back
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355. =head2 C<temp_pool>
  356.  
  357. Pool for scratch memory; persists during configuration, but destroyed
  358. before the first request is served.
  359.  
  360.   $p = $parms->temp_pool;
  361.  
  362. =over 4
  363.  
  364. =item obj: C<$parms>
  365. ( C<L<Apache::CmdParms object|docs::2.0::api::Apache::CmdParms>> )
  366.  
  367. =item ret: C<$p>
  368. ( C<L<APR::Pool object|docs::2.0::api::APR::Pool>> )
  369.  
  370. =item since: 1.99_12
  371.  
  372. =back
  373.  
  374. Most likely you shouldn't use this pool object, unless you know what
  375. you are doing. Use C<L<$parms-E<gt>pool|/C_pool_>> instead.
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383. =head1 Unsupported API
  384.  
  385. C<Apache::CmdParms> also provides auto-generated Perl interface for
  386. a few other methods which aren't tested at the moment and therefore
  387. their API is a subject to change. These methods will be finalized
  388. later as a need arises. If you want to rely on any of the following
  389. methods please contact the L<the mod_perl development mailing
  390. list|maillist::dev> so we can help each other take the steps necessary
  391. to shift the method to an officially supported API.
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398. =head2 C<context>
  399.  
  400. Get context containing pointers to modules' per-dir
  401. config structures.
  402.  
  403.   $context = $parms->context;
  404.  
  405. =over 4
  406.  
  407. =item obj: C<$parms>
  408. ( C<L<Apache::CmdParms object|docs::2.0::api::Apache::CmdParms>> )
  409.  
  410. =item ret: C<$newval>
  411. ( C<L<Apache::ConfVector object|docs::2.0::api::Apache::ConfVector>> )
  412.  
  413. Returns the commands' per-dir config structures
  414.  
  415. =item since: 1.99_12
  416.  
  417. =back
  418.  
  419.  
  420.  
  421.  
  422.  
  423. =head1 See Also
  424.  
  425. L<mod_perl 2.0 documentation|docs::2.0::index>.
  426.  
  427.  
  428.  
  429.  
  430. =head1 Copyright
  431.  
  432. mod_perl 2.0 and its core modules are copyrighted under
  433. The Apache Software License, Version 2.0.
  434.  
  435.  
  436.  
  437.  
  438. =head1 Authors
  439.  
  440. L<The mod_perl development team and numerous
  441. contributors|about::contributors::people>.
  442.  
  443. =cut
  444.  
  445.