stas 2004/01/14 15:39:22 Modified: src/docs/2.0/api/Apache RequestUtil.pod ServerUtil.pod SubProcess.pod SubRequest.pod URI.pod Util.pod Log: autogeneration cleanup is done now Revision Changes Path 1.7 +8 -3 modperl-docs/src/docs/2.0/api/Apache/RequestUtil.pod Index: RequestUtil.pod =================================================================== RCS file: /home/cvs/modperl-docs/src/docs/2.0/api/Apache/RequestUtil.pod,v retrieving revision 1.6 retrieving revision 1.7 diff -u -u -r1.6 -r1.7 --- RequestUtil.pod 14 Jan 2004 09:23:47 -0000 1.6 +++ RequestUtil.pod 14 Jan 2004 23:39:22 -0000 1.7 @@ -558,17 +558,22 @@ can be manipulated via the C<L<APR::Table|docs::2.0::api::APR::Table>> methods. - $ret = $r->dir_config($key, $val); + $table = $r->dir_config(); + $value = $r->dir_config($key); + @values = $r->dir_config($key); + $r->dir_config($key, $val); =over 4 =item arg1: C<$r> (C<L<Apache::RequestRec|docs::2.0::api::Apache::RequestRec>>) -=item arg2: C<$key> (string) +=item opt arg2: C<$key> (string) -=item arg3: C<$val> (string) +=item opt arg3: C<$val> (string) =item ret: C<$ret> (scalar) + +Depends on the passed arguments, see further discussion =back 1.7 +230 -64 modperl-docs/src/docs/2.0/api/Apache/ServerUtil.pod Index: ServerUtil.pod =================================================================== RCS file: /home/cvs/modperl-docs/src/docs/2.0/api/Apache/ServerUtil.pod,v retrieving revision 1.6 retrieving revision 1.7 diff -u -u -r1.6 -r1.7 --- ServerUtil.pod 14 Jan 2004 22:31:27 -0000 1.6 +++ ServerUtil.pod 14 Jan 2004 23:39:22 -0000 1.7 @@ -43,9 +43,100 @@ returns the value set by the C<ServerRoot> directive. +=head1 Functions API -=head1 API + + +=head2 C<add_version_component> + +META: Autogenerated - needs to be reviewed/completed + +Add a component to the version string + + add_version_component($pconf_pool, $component); + +=over 4 + +=item arg1: C<$pconf> (C<L<APR::Pool|docs::2.0::api::APR::Pool>>) + +The pool to allocate the component from (should really be a +C<$pconf_pool>) + +=item arg2: C<$component> (string) + +The string to add + +=item ret: no return value + +=back + + + + + +=head2 C<exists_config_define> + +Check for a definition from the server command line + + $result = Apache::exists_config_define($name); + +=over 4 + +=item arg1: C<$name> (string) + +The define to check for + +=item ret: C<$result> (integer) + +true if defined, false otherwise + +=back + +For example: + + print "this is mp2" if Apache::exists_config_define('MODPERL2'); + + + + + +=head2 C<get_server_built> + +META: Autogenerated - needs to be reviewed/completed + +Get the date and time that the server was built + + $when_built = Apache::get_server_built(); + +=over 4 + +=item ret: C<$when_built> (string) + +The server build time string + +=back + + + + +=head2 C<get_server_version> + +Get the server version string + + Apache::get_server_version(); + +=over 4 + +=item ret: C<$ret> (string) + +The server version string + +=back + + + +=head1 Methods API C<Apache::ServerUtil> provides the following functions and/or methods: @@ -81,23 +172,21 @@ constant. -=head2 C<add_version_component> -META: Autogenerated - needs to be reviewed/completed -Add a component to the version string +=head2 C<error_log2stderr> - $pconf->add_version_component($component); +META: Autogenerated - needs to be reviewed/completed -=over 4 +Convert stderr to the error log -=item arg1: C<$pconf> (C<L<APR::Pool|docs::2.0::api::APR::Pool>>) + $s->error_log2stderr(); -The pool to allocate the component from +=over 4 -=item arg2: C<$component> (C<L<APR::Pool|docs::2.0::api::APR::Pool>>) +=item arg1: C<$s> (C<L<Apache::Server|docs::2.0::api::Apache::Server>>) -The string to add +The current server =item ret: no return value @@ -105,169 +194,246 @@ - - -=head2 C<error_log2stderr> +=head2 C<psignature> META: Autogenerated - needs to be reviewed/completed -Convert stderr to the error log +Get HTML describing the address and (optionally) admin of the server. - $s->error_log2stderr(); + $sig = $r->psignature($prefix); =over 4 -=item arg1: C<$s> (C<L<Apache::Server|docs::2.0::api::Apache::Server>>) +=item arg1: C<$r> (C<L<Apache::RequestRec|docs::2.0::api::Apache::RequestRec>>) -The current server +=item arg2: C<$prefix> (string) -=item ret: no return value +Text which is prepended to the return value -=back +=item ret: C<$sig> (string) +HTML describing the server +=back -=head2 C<exists_config_define> -META: Autogenerated - needs to be reviewed/completed -Check for a definition from the server command line +=head2 C<dir_config> - $ret = exists_config_define($name); +dir_config() provides an interface for the per-server variables +specified by the C<PerlSetVar> and C<PerlAddVar> directives, and also +can be manipulated via the C<APR::Table> methods. + + $table = $s->dir_config(); + $value = $s->dir_config($key); + @values = $s->dir_config($key); + $s->dir_config($key, $val); =over 4 -=item arg1: C<$name> (string) +=item arg1: C<$s> (C<L<Apache::Server|docs::2.0::api::Apache::Server>>) -The define to check for +=item opt arg2: C<$key> (string) -=item ret: C<$ret> (integer) +=item opt arg3: C<$val> (string) -1 if defined, 0 otherwise +=item ret: C<$ret> (scalar) + +Depends on the passed arguments, see further discussion =back +The keys are case-insensitive. + $t = $s->dir_config(); +dir_config() called in a scalar context without the C<$key> argument +returns a I<HASH> reference blessed into the I<APR::Table> class. This +object can be manipulated via the I<APR::Table> methods. For available +methods see I<APR::Table>. + @values = $s->dir_config($key); -=head2 C<get_server_built> +If the C<$key> argument is passed in the list context a list of all +matching values will be returned. This method is ineffective for big +tables, as it does a linear search of the table. Thefore avoid using +this way of calling dir_config() unless you know that there could be +more than one value for the wanted key and all the values are wanted. -META: Autogenerated - needs to be reviewed/completed + $value = $s->dir_config($key); -Get the date a time that the server was built +If the C<$key> argument is passed in the scalar context only a single +value will be returned. Since the table preserves the insertion order, +if there is more than one value for the same key, the oldest value +assosiated with the desired key is returned. Calling in the scalar +context is also much faster, as it'll stop searching the table as soon +as the first match happens. + $s->dir_config($key => $val); -=over 4 +If the C<$key> and the C<$val> arguments are used, the set() operation +will happen: all existing values associated with the key C<$key> (and +the key itself) will be deleted and C<$value> will be placed instead. -=item ret: C<$ret> (string) + $s->dir_config($key => undef); -The server build time string +If C<$val> is I<undef> the unset() operation will happen: all existing +values associated with the key C<$key> (and the key itself) will be +deleted. -=back +=head2 C<is_perl_option_enabled> -=head2 C<get_server_version> +check whether a server level PerlOptions flag is enabled or not. -META: Autogenerated - needs to be reviewed/completed + $result = $s->is_perl_option_enabled($flag); -Get the server version string =over 4 -=item ret: C<$ret> (string) +=item arg1: C<$s> (C<L<Apache::Server|docs::2.0::api::Apache::Server>>) -The server version string +=item arg2: C<$flag> (string) + +=item ret: C<$result> (integer) =back +For example to check whether the C<ChildExit> hook is enabled (which +can be disabled with C<PerlOptions -ChildExit>) and configure some +handlers to run if enabled: + $s->push_handlers(ChildExit => \&child_exit) + if $s->is_perl_option_enabled('ChildExit'); +See also: +L<PerlOptions|docs::2.0::user::config::config/C_PerlOptions_> and +L<the equivalent function for directory level PerlOptions +flags|docs::2.0::api::Apache::RequestUtil/C_is_perl_option_enabled_>. -=head2 C<psignature> -META: Autogenerated - needs to be reviewed/completed [EMAIL PROTECTED] * -Get HTML describing the address and (optionally) admin of the server. +=head2 C<get_handlers> - $ret = $r->psignature($prefix); +Returns a reference to a list of handlers enabled for +a given phase. -=over 4 + @handlers = $s->get_handlers($hook_name); -=item arg1: C<$r> (C<L<Apache::RequestRec|docs::2.0::api::Apache::RequestRec>>) +=over 4 -The request_rec +=item arg1: C<$s> (C<L<Apache::Server|docs::2.0::api::Apache::Server>>) -=item arg2: C<$prefix> (C<L<Apache::RequestRec|docs::2.0::api::Apache::RequestRec>>) +=item arg2: C<$hook_name> (string) -Text which is prepended to the return value +a string representing the phase to handle. -=item ret: C<$ret> (string) +=item ret: C<@handlers> (CODE ref or ref to ARRAY of CODE refs) -HTML describing the server, allocated in @a r's pool. +a list of references to the handler subroutines =back +For example: + @handlers = $s->get_handlers('PerlResponseHandler'); -=head2 C<dir_config> -META: Autogenerated - needs to be reviewed/completed +=head2 C<push_handlers> +META: Autogenerated - needs to be reviewed/completed +Add one or more handlers to a list of handlers to be called for a +given phase. - $ret = $s->dir_config($key, $sv_val); + $s->push_handlers($hook_name => \&handler); + $s->push_handlers($hook_name => [\&handler, \&handler2]); =over 4 =item arg1: C<$s> (C<L<Apache::Server|docs::2.0::api::Apache::Server>>) +=item arg2: C<$hook_name> (string) +a string representing the phase to handle. -=item arg2: C<$key> (C<L<Apache::Server|docs::2.0::api::Apache::Server>>) +=item arg3: C<$handlers> (CODE ref or ref to ARRAY of CODE refs) +a reference to a list of references to the handler subroutines, or a +single reference to a handler subroutine +=item ret: no return value -=item arg3: C<$sv_val> (string) +=back +Examples: + $s->push_handlers(PerlResponseHandler => \&handler); + $s->push_handlers(PerlResponseHandler => [\&handler, \&handler2]); -=item ret: C<$ret> (scalar) + # XXX: not implemented yet + $s->push_handlers(PerlResponseHandler => sub {...}); -=back +=head2 C<set_handlers> +META: Autogenerated - needs to be reviewed/completed +Set a list of handlers to be called for a given phase. + $s->set_handlers($hook_name => \&handler); + $s->set_handlers($hook_name => [\&handler, \&handler2]); +=over 4 -=head2 C<server> +=item arg1: C<$s> (C<L<Apache::Server|docs::2.0::api::Apache::Server>>) -META: Autogenerated - needs to be reviewed/completed +=item arg2: C<$hook_name> (string) +a string representing the phase to handle. +=item arg3: C<$handlers> (CODE ref or ref to ARRAY of CODE refs) - $ret = server($classname); +a reference to a list of references to the handler subroutines, or a +single reference to a handler subroutine -=over 4 +=item ret: no return value + +=back -=item arg1: C<$classname> (scalar) +Examples: + $s->set_handlers(PerlResponseHandler => \&handler); + $s->set_handlers(PerlResponseHandler => [\&handler, \&handler2]); + # XXX: not implemented yet + $s->set_handlers(PerlResponseHandler => sub {...}); -=item ret: C<$ret> (C<L<Apache::Server|docs::2.0::api::Apache::Server>>) + + + +=head2 C<server> + +Get the main server's object + + $main_s = Apache->server(); + +=over 4 + +=item arg1: C<Apache> (class name) + +=item ret: C<$main_s> (C<L<Apache::Server|docs::2.0::api::Apache::Server>>) =back 1.2 +33 -3 modperl-docs/src/docs/2.0/api/Apache/SubProcess.pod Index: SubProcess.pod =================================================================== RCS file: /home/cvs/modperl-docs/src/docs/2.0/api/Apache/SubProcess.pod,v retrieving revision 1.1 retrieving revision 1.2 diff -u -u -r1.1 -r1.2 --- SubProcess.pod 27 Jan 2003 04:05:12 -0000 1.1 +++ SubProcess.pod 14 Jan 2004 23:39:22 -0000 1.2 @@ -2,7 +2,7 @@ Apache::SubProcess -- Executing SubProcesses from mod_perl -=head1 SYNOPSIS +=head1 Synopsis use Apache::SubProcess (); @@ -39,14 +39,20 @@ return defined $data ? $data : ''; } -=head1 DESCRIPTION + + + +=head1 Description C<Apache::SubProcess> provides the Perl API for running and communicating with processes spawned from mod_perl handlers. + + =head1 API -=head2 spawn_proc_prog() + +=head2 C<spawn_proc_prog> $out_fh = Apache::SubProcess::spawn_proc_prog($r, $command, [EMAIL PROTECTED]); @@ -84,5 +90,29 @@ perlio-disabled Perl and do nothing for perlio-enabled Perl, hence you can use something similar to the read_data() wrapper shown in the L<SYNOPSIS|/SYNOPSIS> section. + + + + + +=head1 See Also + +L<mod_perl 2.0 documentation|docs::2.0::index>. + + + + +=head1 Copyright + +mod_perl 2.0 and its core modules are copyrighted under +The Apache Software License, Version 1.1. + + + + +=head1 Authors + +L<The mod_perl development team and numerous +contributors|about::contributors::people>. =cut 1.2 +32 -31 modperl-docs/src/docs/2.0/api/Apache/SubRequest.pod Index: SubRequest.pod =================================================================== RCS file: /home/cvs/modperl-docs/src/docs/2.0/api/Apache/SubRequest.pod,v retrieving revision 1.1 retrieving revision 1.2 diff -u -u -r1.1 -r1.2 --- SubRequest.pod 14 Jan 2004 09:23:47 -0000 1.1 +++ SubRequest.pod 14 Jan 2004 23:39:22 -0000 1.2 @@ -1,6 +1,6 @@ =head1 NAME -Apache::SubRequest - Perl API for XXX +Apache::SubRequest - Perl API for Apache subrequests @@ -64,7 +64,7 @@ The current request -=item arg2: C<$sub_req> (C<L<Apache::RequestRec|docs::2.0::api::Apache::RequestRec>>) +=item arg2: C<$sub_req> (string) A subrequest created from this request @@ -80,9 +80,10 @@ META: Autogenerated - needs to be reviewed/completed -Then there's the case that you want some other request to be served -as the top-level request INSTEAD of what the client requested directly. -If so, call this from a handler, and then immediately return OK. * +Then there's the case that you want some other request to be served as +the top-level request INSTEAD of what the client requested directly. +If so, call this from a handler, and then immediately return OK. + Redirect the current request to some other uri $r->internal_redirect($new_uri); @@ -93,7 +94,7 @@ The current request -=item arg2: C<$new_uri> (C<L<Apache::RequestRec|docs::2.0::api::Apache::RequestRec>>) +=item arg2: C<$new_uri> (string) The URI to replace the current request with @@ -110,8 +111,8 @@ META: Autogenerated - needs to be reviewed/completed This function is designed for things like actions or CGI scripts, when -using AddHandler, and you want to preserve the content type across -an internal redirect. +using AddHandler, and you want to preserve the content type across an +internal redirect. $r->internal_redirect_handler($new_uri); @@ -121,7 +122,7 @@ The current request -=item arg2: C<$new_uri> (C<L<Apache::RequestRec|docs::2.0::api::Apache::RequestRec>>) +=item arg2: C<$new_uri> (string) The URI to replace the current request with. @@ -140,7 +141,7 @@ Create a sub request for the given apr_dir_read result. This sub request can be inspected to find information about the requested file - $ret = $r->lookup_dirent($finfo, $subtype, $next_filter); + $lr = $r->lookup_dirent($finfo, $subtype, $next_filter); =over 4 @@ -148,24 +149,23 @@ The current request -=item arg2: C<$finfo> (C<L<Apache::RequestRec|docs::2.0::api::Apache::RequestRec>>) +=item arg2: C<$finfo> (C<L<APR::Finfo|docs::2.0::api::APR::Finfo>>) The apr_dir_read result to lookup -=item arg3: C<$subtype> (C<L<APR::Finfo|docs::2.0::api::APR::Finfo>>) +=item arg3: C<$subtype> (integer) What type of subrequest to perform, one of; -E<lt>PREE<gt> - AP_SUBREQ_NO_ARGS ignore r-E<gt>args and r-E<gt>path_info - AP_SUBREQ_MERGE_ARGS merge r-E<gt>args and r-E<gt>path_info -E<lt>/PREE<gt> + + Apache::SUBREQ_NO_ARGS ignore r->args and r->path_info + Apache::SUBREQ_MERGE_ARGS merge r->args and r->path_info =item arg4: C<$next_filter> (integer) The first filter the sub_request should use. If this is NULL, it defaults to the first filter for the main request -=item ret: C<$ret> (C<L<Apache::RequestRec|docs::2.0::api::Apache::RequestRec>>) +=item ret: C<$lr> (C<L<Apache::RequestRec|docs::2.0::api::Apache::RequestRec>>) The new request record @@ -190,14 +190,14 @@ The current request -=item arg2: C<$new_file> (C<L<Apache::RequestRec|docs::2.0::api::Apache::RequestRec>>) +=item arg2: C<$new_file> (string) The URI to lookup -=item arg3: C<$next_filter> (string) +=item arg3: C<$next_filter> (C<L<Apache::Filter|docs::2.0::api::Apache::Filter>>) -The first filter the sub_request should use. If this is -NULL, it defaults to the first filter for the main request +The first filter the sub_request should use. If this is NULL, it +defaults to the first filter for the main request =item ret: C<$ret> (C<L<Apache::SubRequest|docs::2.0::api::Apache::SubRequest>>) @@ -214,7 +214,7 @@ META: Autogenerated - needs to be reviewed/completed Create a sub request from the given URI. This sub request can be -inspected to find information about the requested URI +inspected to find information about the requested URI. $ret = $r->lookup_uri($new_file, $next_filter); @@ -224,14 +224,14 @@ The current request -=item arg2: C<$new_file> (C<L<Apache::RequestRec|docs::2.0::api::Apache::RequestRec>>) +=item arg2: C<$new_file> (string) The URI to lookup -=item arg3: C<$next_filter> (string) +=item arg3: C<$next_filter> (C<L<Apache::Filter|docs::2.0::api::Apache::Filter>>) -The first filter the sub_request should use. If this is -NULL, it defaults to the first filter for the main request +The first filter the sub_request should use. If this is NULL, it +defaults to the first filter for the main request =item ret: C<$ret> (C<L<Apache::SubRequest|docs::2.0::api::Apache::SubRequest>>) @@ -248,7 +248,8 @@ META: Autogenerated - needs to be reviewed/completed Create a sub request for the given URI using a specific method. This -sub request can be inspected to find information about the requested URI +sub request can be inspected to find information about the requested +URI $ret = $r->lookup_method_uri($method, $new_file, $next_filter); @@ -258,7 +259,7 @@ The current request -=item arg2: C<$method> (C<L<Apache::RequestRec|docs::2.0::api::Apache::RequestRec>>) +=item arg2: C<$method> (string) The method to use in the new sub request @@ -266,10 +267,10 @@ The URI to lookup -=item arg4: C<$next_filter> (string) +=item arg4: C<$next_filter> (C<L<Apache::Filter|docs::2.0::api::Apache::Filter>>) -The first filter the sub_request should use. If this is -NULL, it defaults to the first filter for the main request +The first filter the sub_request should use. If this is NULL, it +defaults to the first filter for the main request =item ret: C<$ret> (C<L<Apache::SubRequest|docs::2.0::api::Apache::SubRequest>>) 1.2 +10 -10 modperl-docs/src/docs/2.0/api/Apache/URI.pod Index: URI.pod =================================================================== RCS file: /home/cvs/modperl-docs/src/docs/2.0/api/Apache/URI.pod,v retrieving revision 1.1 retrieving revision 1.2 diff -u -u -r1.1 -r1.2 --- URI.pod 14 Jan 2004 09:23:47 -0000 1.1 +++ URI.pod 14 Jan 2004 23:39:22 -0000 1.2 @@ -1,6 +1,6 @@ =head1 NAME -Apache::URI - Perl API for XXX +Apache::URI - Perl API for manipulating URIs @@ -34,7 +34,7 @@ Construct a full hostname - $ret = $r->construct_server($hostname, $port, $p); + $hostname = $r->construct_server($hostname, $port, $p); =over 4 @@ -42,7 +42,7 @@ The current request -=item arg2: C<$hostname> (C<L<Apache::RequestRec|docs::2.0::api::Apache::RequestRec>>) +=item arg2: C<$hostname> (string) The hostname of the server @@ -50,11 +50,11 @@ The port the server is running on -=item arg4: C<$p> (integer) +=item arg4: C<$p> (C<L<APR::Pool|docs::2.0::api::APR::Pool>>) The pool to allocate from -=item ret: C<$ret> (string) +=item ret: C<$hostname> (string) The server's hostname @@ -68,8 +68,8 @@ META: Autogenerated - needs to be reviewed/completed -and SERVER_NAME. * -build a fully qualified URL from the uri and information in the request rec +build a fully qualified URL from the uri and information in the +request rec $ret = $r->construct_url($uri, $p); @@ -79,11 +79,11 @@ The current request -=item arg2: C<$uri> (C<L<Apache::RequestRec|docs::2.0::api::Apache::RequestRec>>) +=item arg2: C<$uri> (string) The path to the requested file -=item arg3: C<$p> (string) +=item arg3: C<$p> (C<L<APR::Pool|docs::2.0::api::APR::Pool>>) The pool to allocate the URL from @@ -111,7 +111,7 @@ The current request -=item arg2: C<$uri> (C<L<Apache::RequestRec|docs::2.0::api::Apache::RequestRec>>) +=item arg2: C<$uri> (string) The uri to break apart 1.2 +8 -8 modperl-docs/src/docs/2.0/api/Apache/Util.pod Index: Util.pod =================================================================== RCS file: /home/cvs/modperl-docs/src/docs/2.0/api/Apache/Util.pod,v retrieving revision 1.1 retrieving revision 1.2 diff -u -u -r1.1 -r1.2 --- Util.pod 14 Jan 2004 09:23:47 -0000 1.1 +++ Util.pod 14 Jan 2004 23:39:22 -0000 1.2 @@ -21,7 +21,7 @@ -=head1 API +=head1 Functions API C<Apache::Util> provides the following functions and/or methods: @@ -34,11 +34,11 @@ Convert a time from an integer into a string in a specified format - $ret = format_time($t, $fmt, $gmt, $p); + $time_str = Apache::format_time($time, $fmt, $gmt, $p); =over 4 -=item arg1: C<$t> (number) +=item arg1: C<$time> (number) The time to convert @@ -54,7 +54,7 @@ The pool to allocate memory from -=item ret: C<$ret> (string) +=item ret: C<$time_str> (string) The string that represents the specified time @@ -70,7 +70,7 @@ convert an OS path to a URL in an OS dependant way. - $ret = escape_path($path, $p, $partial); + $path = Apache::escape_path($path, $p, $partial); =over 4 @@ -84,10 +84,10 @@ =item arg3: C<$partial> (integer) -if set, assume that the path will be appended to something -with a '/' in it (and thus does not prefix "./") +if set, assume that the path will be appended to something with a '/' +in it (and thus does not prefix "./") -=item ret: C<$ret> (string) +=item ret: C<$path> (string) The converted URL
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]