gozer 2004/08/10 11:13:24
Modified: src/docs/2.0/api/Apache Module.pod
Log:
Reviewed and completed Apache::Module API documentation
Revision Changes Path
1.5 +54 -61 modperl-docs/src/docs/2.0/api/Apache/Module.pod
Index: Module.pod
===================================================================
RCS file: /home/cvs/modperl-docs/src/docs/2.0/api/Apache/Module.pod,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- Module.pod 10 Aug 2004 03:35:26 -0000 1.4
+++ Module.pod 10 Aug 2004 18:13:23 -0000 1.5
@@ -8,15 +8,27 @@
=head1 Synopsis
use Apache::Module ();
-
-META: to be completed
-
+
+ for (my $modp = Apache::Module->top_module; $modp; $modp = $modp->next) {
+ my $name = $modp->name;
+ my $version = $modp->version;
+ my $minor_version = $modp->minor_version;
+ my $index = $modp->module_index;
+ my $commands = $modp->cmds;
+ }
+
+ sub MyDirective {
+ my ($self, $parms, $args) = @_;
+ my $srv_cfg = Apache::Module->get_config($self, $parms->server);
+ [...]
+ }
=head1 Description
-META: to be completed
+The API provided by this module opens up access to Apache's internal module
+list. It can be used to find and query currently enabled/loaded modules.
See L<Apache Server Configuration Customization in
Perl|docs::2.0::user::config::custom>.
@@ -33,9 +45,7 @@
=head2 C<cmds>
-META: Autogenerated - needs to be reviewed/completed
-
-A command_rec table that describes all of the directives this module
+An Apache::Command table that describes all of the directives this module
defines.
$cmd_rec = $module->cmds();
@@ -58,33 +68,33 @@
-=head2 C<dynamic_load_handle>
-
-META: Autogenerated - needs to be reviewed/completed
+=head2 C<get_config>
-The handle for the DSO. Internal use only
+Retrieves a module's configuration. Used by configuration directives.
- $dl_handle = $module->dynamic_load_handle();
+ $cfg = Apache::Module->get_config($self, $parms->server);
+ $cfg = Apache::Module->get_config($self, $r->server, $r->per_dir_config);
=over 4
-=item obj: C<$module>
-( C<L<Apache::Module object|docs::2.0::api::Apache::Module>> )
-
-=item ret: C<$dl_handle> ( SCALAR )
-
-=item since: 1.99_12
-
-=back
+=item obj: C<$self> ( string or ref )
+The name of the Perl module this configuration is for
+=item obj: C<$server>
+( C<L<Apache::ServerRec object|docs::2.0::api::Apache::ServerRec>> )
+=item obj: C<$dir_config>
+( C<L<Apache::ConfVector object|docs::2.0::api::Apache::ConfVector>> )
+=item ret: C<$cfg> (HASH)
+The hash holding the module configuration data.
+=back
+See also L<Apache Server Configuration Customization in
Perl|docs::2.0::user::config::custom>
-=head2 C<get_config>
@@ -92,11 +102,9 @@
=head2 C<find_linked_module>
-META: Autogenerated - needs to be reviewed/completed
-
Find a module based on the name of the module
- $ret = find_linked_module($name);
+ $modp = Apache::Module->find_linked_module($name);
=over 4
@@ -104,10 +112,10 @@
the name of the module
-=item ret: C<$ret>
+=item ret: C<$modp>
( C<L<Apache::Module object|docs::2.0::api::Apache::Module>> )
-the module structure if found, NULL otherwise
+the module structure if found, undef otherwise
=item since: 1.99_12
@@ -117,40 +125,36 @@
-=head2 C<find_module_name>
+=head2 C<loaded>
-META: Autogenerated - needs to be reviewed/completed
+Determines if a certain module is loaded
-Find the name of the specified module
+ if (Apache::Module->loaded($module)) {
+ [...]
+ }
+
+ if (Apache::Module->loaded('Apache::Status')) {
+ [...]
+ }
- $ret = $module->find_module_name();
+The argument to this function can be many things. If the module ends in
+'.c', true will be returned if that module is loaded If the module ends
+in '.so', true will be returned if that module is loaded and was loaded
+as a DSO with LoadModule. Otherwise, true will be returned if that Perl
+module is loaded.
=over 4
-=item obj: C<$module>
-( C<L<Apache::Module object|docs::2.0::api::Apache::Module>> )
-
-The module to get the name for
-
-=item ret: C<$ret> ( string )
+=item name: C<$module> ( string )
the name of the module
-=item since: 1.99_12
+=item ret: ( boolean )
=back
-
-
-=head2 C<loaded>
-
-
-
-
=head2 C<minor_version>
-META: Autogenerated - needs to be reviewed/completed
-
API minor version. Provides API feature milestones. Not checked
during module init
@@ -173,8 +177,6 @@
=head2 C<module_index>
-META: Autogenerated - needs to be reviewed/completed
-
Index to this modules structures in config vectors.
$index = $module->module_index();
@@ -196,8 +198,6 @@
=head2 C<name>
-META: Autogenerated - needs to be reviewed/completed
-
The name of the module's C file
$name = $module->name();
@@ -219,9 +219,7 @@
=head2 C<next>
-META: Autogenerated - needs to be reviewed/completed
-
-A pointer to the next module in the list
+The next module in the list, undef if the last module in the list.
$next_module = $module->next();
@@ -246,8 +244,6 @@
=head2 C<remove_loaded_module>
-META: Autogenerated - needs to be reviewed/completed
-
Remove a module from the chained modules list and the list of loaded
modules
@@ -269,8 +265,6 @@
=head2 C<remove_module>
-META: Autogenerated - needs to be reviewed/completed
-
Remove a module from the server. There are some caveats:
when the module is removed, its slot is lost so all the current
per-dir and per-server configurations are invalid. So we should
@@ -299,7 +293,8 @@
=head2 C<top_module>
-META: Autogenerated - needs to be reviewed/completed
+Returns the first module in the module list. Usefull to start a
+module iteration.
$ret = Apache::Module->top_module();
@@ -320,9 +315,7 @@
=head2 C<version>
-META: Autogenerated - needs to be reviewed/completed
-
-API version, *not* module version; check that module is
+API version, B<not> module version; check that module is
compatible with this version of the server.
$version = $module->version();
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]