Fred Moyer wrote:
> For some reason, while testing with mod_perl1 I get this error message:
>
> waiting 60 seconds for server to start: .Syntax error on line 22 of
> /home/fred/dev/apache-dispatch/trunk/t/conf/extra.last.conf:
> Can't locate auto/Apache/Dispatch/DispatchReq.al in @INC (@INC contains:
Here's the work around I've used so that the DispatchRequire et al.
method calls can be shared Apache2::Dispatch and Apache::Dispatch.
Geoff if you have any ideas about why I hit this problem, or how to fix
it more cleanly please let me know. This seems like it *might* be a
mod_perl1 inheritance / command table method name issue - if it looks
that way to you then I'll put together a reproducible case and send it
to the mod_perl list.
--- trunk/lib/Apache/Dispatch.pm 2006-05-22 01:28:57 UTC (rev 31)
+++ trunk/lib/Apache/Dispatch.pm 2006-05-22 06:20:02 UTC (rev 32)
@@ -15,16 +15,38 @@
use mod_perl 1.2401;
use Apache::Constants qw(OK DECLINED SERVER_ERROR);
-use Apache::Log ();
-use Apache::Dispatch::Util;
-push @Apache::Dispatch::ISA, qw(Apache::Dispatch::Util);
+use Apache::Log ();
+use Apache::Dispatch::Util ();
+BEGIN {
+ push @Apache::Dispatch::ISA, qw(Apache::Dispatch::Util);
+
+ {
+
+
#---------------------------------------------------------------------
+ # there is a problem with using command_table methods with
inheritance
+ # so here we map the command table directive names to the
methods in
+ # Apache::Dispatch::Util using the symbol table. this allows us to
+ # share the code between Apache::Dispatch and Apache2::Dispatch
+
#---------------------------------------------------------------------
+
+ my @dir_names =
+ map { $_->{name} } @{Apache::Dispatch::Util->directives};
+ no strict 'refs';
+ foreach my $directive (@dir_names) {
+ *{"Apache::Dispatch::$directive"} =
+ \&{"Apache::Dispatch::Util::$directive"};
+ }
+
+ }
+}
+
|