dougm 01/10/08 13:07:33
Modified: lib/Apache compat.pm
Log:
cannot use stash_rgy_endav to register cleanup to run END blocks,
since stash_rgy_endav is only called when the script is compiled.
so add something that can be configured as PerlHandler to run them
Revision Changes Path
1.20 +16 -11 modperl-2.0/lib/Apache/compat.pm
Index: compat.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/lib/Apache/compat.pm,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- compat.pm 2001/10/08 17:58:16 1.19
+++ compat.pm 2001/10/08 20:07:33 1.20
@@ -150,23 +150,28 @@
return $r->parse_args($buf)
}
-sub rgy_script_name {
- require ModPerl::Global;
- 'Apache::ROOT' . $_[0];
-}
-
sub clear_rgy_endav {
my($r, $script_name) = @_;
- my $package = rgy_script_name($script_name);
+ require ModPerl::Global;
+ my $package = 'Apache::ROOT' . $script_name;
ModPerl::Global::special_list_clear(END => $package);
}
sub stash_rgy_endav {
- my($r, $script_name) = @_;
- my $package = rgy_script_name($script_name);
- $r->pool->cleanup_register(sub {
- ModPerl::Global::special_list_call(END => $package);
- });
+ #see run_rgy_endav
+}
+
+#if somebody really wants to have END subroutine support
+#with the 1.x Apache::Registry they will need to configure:
+# PerlHandler Apache::Registry Apache::compat::run_rgy_endav
+sub Apache::compat::run_rgy_endav {
+ my $r = shift;
+
+ require ModPerl::Global;
+ require Apache::PerlRun; #1.x's
+ my $package = Apache::PerlRun->new($r)->namespace;
+
+ ModPerl::Global::special_list_call(END => $package);
}
sub seqno {