stas 01/11/14 00:50:00 Modified: src/api/mod_perl-2.0/Apache RequestRec.pod ServerUtil.pod Log: - document Apache::server_root_relative - fix $s->dir_config Revision Changes Path 1.3 +4 -4 modperl-docs/src/api/mod_perl-2.0/Apache/RequestRec.pod Index: RequestRec.pod =================================================================== RCS file: /home/cvs/modperl-docs/src/api/mod_perl-2.0/Apache/RequestRec.pod,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- RequestRec.pod 2001/10/10 05:06:36 1.2 +++ RequestRec.pod 2001/11/14 08:50:00 1.3 @@ -46,7 +46,7 @@ object can be manipulated via the I<APR::Table> methods. For available methods see I<APR::Table>. - @values = $r->dir_config( $key ); + @values = $r->dir_config($key); 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 @@ -54,7 +54,7 @@ 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. - $value = $r->dir_config( $key ); + $value = $r->dir_config($key); 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, @@ -63,13 +63,13 @@ context is also much faster, as it'll stop searching the table as soon as the first match happens. - $r->dir_config( $key => $val ); + $r->dir_config($key => $val); 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. - $r->dir_config( $key => undef ); + $r->dir_config($key => undef); 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 1.2 +31 -4 modperl-docs/src/api/mod_perl-2.0/Apache/ServerUtil.pod Index: ServerUtil.pod =================================================================== RCS file: /home/cvs/modperl-docs/src/api/mod_perl-2.0/Apache/ServerUtil.pod,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- ServerUtil.pod 2001/10/10 05:06:36 1.1 +++ ServerUtil.pod 2001/11/14 08:50:00 1.2 @@ -9,6 +9,12 @@ $s = Apache->server; my $srv_cfg = $s->dir_config; + # get 'conf/' dir path using $r + my $conf_dir = Apache::server_root_relative('conf', $r->pool); + + # get 'log/' dir path using default server startup pool + my $log_dir = Apache::server_root_relative('log'); + =head1 DESCRIPTION META: complete @@ -43,7 +49,7 @@ object can be manipulated via the I<APR::Table> methods. For available methods see I<APR::Table>. - @values = $r->dir_config( $key ); + @values = $s->dir_config($key); 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 @@ -51,7 +57,7 @@ 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. - $value = $r->dir_config( $key ); + $value = $s->dir_config($key); 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, @@ -60,13 +66,13 @@ context is also much faster, as it'll stop searching the table as soon as the first match happens. - $r->dir_config( $key => $val ); + $s->dir_config($key => $val); 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. - $r->dir_config( $key => undef ); + $s->dir_config($key => undef); 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 @@ -77,6 +83,27 @@ =item * add_handlers() =item * get_handlers() + +=item * server_root_relative() + +Returns the canonical form of the filename made absolute to +C<ServerRoot>: + + Apache::server_root_relative([$fname, [$pool]]); + +If C<$fname> is specified, it'll be appended to the value of +C<ServerRoot> and return it. e.g.: + + my $log_dir = Apache::server_root_relative('log', $r->pool); + +If C<$pool> is not specified, the default server startup pool is used +(this style adds an overhead of fetching the startup data). e.g.: + + my $conf_dir = Apache::server_root_relative('conf'); + +If C<$fname> is not specified, the value of C<ServerRoot> is returned +with a trailing C</>. (it's the same as using C<''> as C<$fname>'s +value). =back
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]