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 / Module.pm < prev    next >
Encoding:
Perl POD Document  |  2004-09-23  |  7.3 KB  |  425 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::Module;
  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::Module - Perl API for creating and working with Apache modules
  34.  
  35.  
  36.  
  37.  
  38. =head1 Synopsis
  39.  
  40.   use Apache::Module ();
  41.  
  42.   # iterate over the whole module list
  43.   for (my $modp = Apache::Module->top_module; $modp; $modp = $modp->next) {
  44.       my $name = $modp->name;
  45.       my $version = $modp->version;
  46.       my $minor_version = $modp->minor_version;
  47.       my $index = $modp->module_index;
  48.       my $commands = $modp->cmds;
  49.   }
  50.   
  51.   # find a specific module
  52.   my $module = Apache::Module::find_linked_module('mod_ssl.c');
  53.   
  54.   # remove a specific module
  55.   $module->remove_loaded_module();
  56.   
  57.   # access module configuration from a directive
  58.   sub MyDirective {
  59.       my ($self, $parms, $args) = @_;
  60.       my  $srv_cfg = Apache::Module->get_config($self, $parms->server);
  61.       [...]
  62.   }
  63.   
  64.   # test if an Apache module is loaded
  65.   if (Apache::Module::loaded('mod_ssl.c')) {
  66.       [...]
  67.   }
  68.   
  69.   # test if a Perl module is loaded
  70.   if (Apache::Module::loaded('Apache::Status')) {
  71.       [...]
  72.   }
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80. =head1 Description
  81.  
  82. C<Apache::Module> provides the Perl API for creating and working with
  83. Apache modules
  84.  
  85. See L<Apache Server Configuration Customization in
  86. Perl|docs::2.0::user::config::custom>.
  87.  
  88.  
  89.  
  90.  
  91.  
  92. =head1 API
  93.  
  94. C<Apache::Module> provides the following functions and/or methods:
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101. =head2 C<cmds>
  102.  
  103. The C<L<Apache::Command|docs::2.0::api::Apache::Command>> object
  104. that describes all of the directives this module defines.
  105.  
  106.   $commands = $module->cmds();
  107.  
  108. =over 4
  109.  
  110. =item obj: C<$module>
  111. ( C<L<Apache::Module object|docs::2.0::api::Apache::Module>> )
  112.  
  113. =item ret: C<$commands>
  114. ( C<L<Apache::Command object|docs::2.0::api::Apache::Command>> )
  115.  
  116. =item since: 1.99_12
  117.  
  118. =back
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126. =head2 C<get_config>
  127.  
  128. Retrieves a module's configuration. Used by configuration directives.
  129.  
  130.   $cfg = Apache::Module->get_config($class, $server, [$dir_config]);
  131.   $cfg = $self->get_config($server, [$dir_config]);
  132.  
  133. =over 4
  134.  
  135. =item obj: C<$module>
  136. ( C<L<Apache::Module object|docs::2.0::api::Apache::Module>> )
  137.  
  138. =item arg1: C<$class> ( string )
  139.  
  140. The perl package this configuration is for
  141.  
  142. =item arg1: C<$server> 
  143. ( C<L<Apache::ServerRec object|docs::2.0::api::Apache::ServerRec>> )
  144.  
  145. The current server, typically C<$r-E<gt>server> or C<$parms-E<gt>server>
  146.  
  147. =item opt arg1: C<$dir_config>
  148. ( C<L<Apache::ConfVector object|docs::2.0::api::Apache::ConfVector>> )
  149.  
  150. By default, the configuration returned is the server level one. To retrieve
  151. the per directory configuration, use C<$r-E<gt>per_dir_config> as a last
  152. argument.
  153.  
  154. =item ret: C<$cfg> (HASH reference)
  155.  
  156. A reference to the hash holding the module configuration data.
  157.  
  158. =item since: 1.99_12
  159.  
  160. =back
  161.  
  162. See also L<Apache Server Configuration Customization in Perl|docs::2.0::user::config::custom>
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169. =head2 C<find_linked_module>
  170.  
  171. Find a module based on the name of the module
  172.  
  173.   $module = Apache::Module::find_linked_module($name);
  174.  
  175. =over 4
  176.  
  177. =item arg1: C<$name> ( string )
  178.  
  179. The name of the module ending in C<.c>
  180.  
  181. =item ret: C<$module>
  182. ( C<L<Apache::Module object|docs::2.0::api::Apache::Module>> )
  183.  
  184. The module object if found, undef otherwise
  185.  
  186. =item since: 1.99_12
  187.  
  188. =back
  189.  
  190.  
  191.  
  192.  
  193.  
  194. =head2 C<loaded>
  195.  
  196. Determines if a certain module is loaded
  197.  
  198.   $loaded = Apache::Module::loaded($module);
  199.  
  200. =over 4
  201.  
  202. =item name: C<$module> ( string )
  203.  
  204. The name of the module to search for.
  205.  
  206. If C<$module> ends with C<.c>, search all the modules,
  207. statically compiled and dynamically loaded.
  208.  
  209. If C<$module> ends with C<.so>, search only the dynamically
  210. loaded modules.
  211.  
  212. If C<$module> doesn't contain a C<.>, search the loaded Perl
  213. modules.
  214.  
  215. =item ret: C<$loaded> ( boolean )
  216.  
  217. Returns true if the module is loaded, false otherwise.
  218.  
  219. =item since: 1.99_12
  220.  
  221. =back
  222.  
  223. For example, to test if this server supports ssl:
  224.  
  225.   if (Apache::Module::loaded('mod_ssl.c')) {
  226.       [...]
  227.   }
  228.  
  229. To test is this server dynamically loaded mod_perl:
  230.  
  231.   if (Apache::Module::loaded('mod_perl.so')) {
  232.       [...]
  233.   }
  234.  
  235. To test if C<L<Apache::Status|docs::2.0::api::Apache::Status>> is
  236. loaded:
  237.  
  238.   if (Apache::Module::loaded('Apache::Status')) {
  239.       [...]
  240.   }
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248. =head2 C<minor_version>
  249.  
  250. API minor version. Provides API feature milestones. Not checked
  251. during module init
  252.  
  253.   $minor_version = $module->minor_version();
  254.  
  255. =over 4
  256.  
  257. =item obj: C<$module>
  258. ( C<L<Apache::Module object|docs::2.0::api::Apache::Module>> )
  259.  
  260. =item ret: C<$minor_version> ( integer )
  261.  
  262. =item since: 1.99_12
  263.  
  264. =back
  265.  
  266.  
  267.  
  268.  
  269.  
  270. =head2 C<module_index>
  271.  
  272. Index to this modules structures in config vectors.
  273.  
  274.   $index = $module->module_index();
  275.  
  276. =over 4
  277.  
  278. =item obj: C<$module>
  279. ( C<L<Apache::Module object|docs::2.0::api::Apache::Module>> )
  280.  
  281. =item ret: C<$index> ( integer )
  282.  
  283. =item since: 1.99_12
  284.  
  285. =back
  286.  
  287.  
  288.  
  289.  
  290.  
  291. =head2 C<name>
  292.  
  293. The name of the module's C file
  294.  
  295.   $name = $module->name();
  296.  
  297. =over 4
  298.  
  299. =item obj: C<$module>
  300. ( C<L<Apache::Module object|docs::2.0::api::Apache::Module>> )
  301.  
  302. =item ret: C<$name> ( string )
  303.  
  304. =item since: 1.99_12
  305.  
  306. =back
  307.  
  308.  
  309.  
  310.  
  311.  
  312. =head2 C<next>
  313.  
  314. The next module in the list, undef if the last module in the list.
  315.  
  316.   $next_module = $module->next();
  317.  
  318. =over 4
  319.  
  320. =item obj: C<$module>
  321. ( C<L<Apache::Module object|docs::2.0::api::Apache::Module>> )
  322.  
  323. =item ret: C<$next_module>
  324. ( C<L<Apache::Module object|docs::2.0::api::Apache::Module>> )
  325.  
  326. =item since: 1.99_12
  327.  
  328. =back
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335. =head2 C<remove_loaded_module>
  336.  
  337. Remove a module from the list of loaded modules permanently.
  338.  
  339.   $module->remove_loaded_module();
  340.  
  341. =over 4
  342.  
  343. =item obj: C<$module>
  344. ( C<L<Apache::Module object|docs::2.0::api::Apache::Module>> )
  345.  
  346. =item ret: no return value
  347.  
  348. =item since: 1.99_12
  349.  
  350. =back
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357. =head2 C<top_module>
  358.  
  359. Returns the first module in the module list. Usefull to start a
  360. module iteration.
  361.  
  362.   $ret = Apache::Module->top_module();
  363.  
  364. =over 4
  365.  
  366. =item obj: C<Apache::Module> ( class name )
  367.  
  368. =item ret: C<$ret>
  369. ( C<L<Apache::Module object|docs::2.0::api::Apache::Module>> )
  370.  
  371. =item since: 1.99_12
  372.  
  373. =back
  374.  
  375.  
  376.  
  377.  
  378.  
  379. =head2 C<version>
  380.  
  381. API version, B<not> module version; check that module is
  382. compatible with this version of the server.
  383.  
  384.   $version = $module->version();
  385.  
  386. =over 4
  387.  
  388. =item obj: C<$module>
  389. ( C<L<Apache::Module object|docs::2.0::api::Apache::Module>> )
  390.  
  391. =item ret: C<$version> ( integer )
  392.  
  393. =item since: 1.99_12
  394.  
  395. =back
  396.  
  397.  
  398.  
  399.  
  400.  
  401. =head1 See Also
  402.  
  403. L<mod_perl 2.0 documentation|docs::2.0::index>.
  404.  
  405.  
  406.  
  407.  
  408. =head1 Copyright
  409.  
  410. mod_perl 2.0 and its core modules are copyrighted under
  411. The Apache Software License, Version 2.0.
  412.  
  413.  
  414.  
  415.  
  416. =head1 Authors
  417.  
  418. L<The mod_perl development team and numerous
  419. contributors|about::contributors::people>.
  420.  
  421. =cut
  422.  
  423.