geoff 2004/01/15 06:33:40
Modified: src/docs/2.0/api/Apache ServerUtil.pod
src/docs/2.0/api/ModPerl RegistryLoader.pod
src/docs/2.0/user/porting compat.pod
Log:
updates for server_root_relative()
Revision Changes Path
1.8 +1 -1 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.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- ServerUtil.pod 14 Jan 2004 23:39:22 -0000 1.7
+++ ServerUtil.pod 15 Jan 2004 14:33:40 -0000 1.8
@@ -13,7 +13,7 @@
my $srv_cfg = $s->dir_config;
# get 'conf/' dir path using $r
- my $conf_dir = $s->server_root_relative('conf', $r->pool);
+ my $conf_dir = $s->server_root_relative($r->pool, 'conf');
# server level PerlOptions flags lookup
$s->push_handlers(ChildExit => \&child_exit)
1.2 +7 -3 modperl-docs/src/docs/2.0/api/ModPerl/RegistryLoader.pod
Index: RegistryLoader.pod
===================================================================
RCS file: /home/cvs/modperl-docs/src/docs/2.0/api/ModPerl/RegistryLoader.pod,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- RegistryLoader.pod 27 Jan 2003 04:05:12 -0000 1.1
+++ RegistryLoader.pod 15 Jan 2004 14:33:40 -0000 1.2
@@ -6,6 +6,7 @@
# in startup.pl
use ModPerl::RegistryLoader ();
+ use APR::Pool ();
# explicit uri => filename mapping
my $rlbb = ModPerl::RegistryLoader->new(
@@ -20,7 +21,7 @@
sub trans {
my $uri = shift;
$uri =~ s|^/registry/|cgi-bin/|;
- return Apache::server_root_relative($uri);
+ return Apache::server_root_relative(APR::Pool->new, $uri);
}
my $rl = ModPerl::RegistryLoader->new(
package => 'ModPerl::Registry',
@@ -128,15 +129,18 @@
{
# test the scripts pre-loading by using trans sub
use ModPerl::RegistryLoader ();
+ use APR::Pool ();
use DirHandle ();
use strict;
- my $dir = Apache::server_root_relative("cgi-bin");
+ my $pool = APR::Pool->new;
+
+ my $dir = Apache::server_root_relative($pool, "cgi-bin");
sub trans {
my $uri = shift;
$uri =~ s|^/registry/|cgi-bin/|;
- return Apache::server_root_relative($uri);
+ return Apache::server_root_relative($pool, $uri);
}
my $rl = ModPerl::RegistryLoader->new(
1.33 +12 -8 modperl-docs/src/docs/2.0/user/porting/compat.pod
Index: compat.pod
===================================================================
RCS file: /home/cvs/modperl-docs/src/docs/2.0/user/porting/compat.pod,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- compat.pod 12 Jan 2004 04:30:46 -0000 1.32
+++ compat.pod 15 Jan 2004 14:33:40 -0000 1.33
@@ -986,16 +986,20 @@
# during startup
my $conf_dir = Apache::server_root_relative($s->pool, 'conf');
-The old way:
+Alternatively:
- my $conf_dir = Apache::server_root_relative('Apache', 'conf');
+ # during request
+ my $conf_dir = $r->server_root_relative('conf');
+ # during startup
+ my $conf_dir = $c->server_root_relative('conf');
-will work as well, but you shouldn't use it, because it'll internally
-use a global pool, which is a bit slower, but the worst drawback is
-that every time you use this way the allocated from this pool memory
-won't be cleaned up, till the server quits so there will be a memory
-leak. When you are inside a request and use C<$r-E<gt>pool>, this pool
-is freed at the end of each request.
+Note that the old form
+
+ my $conf_dir = Apache->server_root_relative('conf');
+
+is no longer valid - C<Apache::server_root_relative> must be called
+from either one of C<$r>, C<$s>, or C<$c>, or be explicitly
+passed a pool.
See the L<Apache::ServerUtil> manpage.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]