perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject [patch] adding Apache::MyConfig to Apache::compat
Date Thu, 28 Nov 2002 16:57:34 GMT
Juan Julian Merelo Guervos needed Apache::MyConfig. Is that correct that 
it's a legacy module and should be only available via compat? If so here 
is the first incomplete porting. I think I've captured all the keys, but 
I'm not sure about all the value. Please verify that those that I've set 
are correct.

Index: lib/Apache/compat.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/lib/Apache/compat.pm,v
retrieving revision 1.71
diff -u -r1.71 compat.pm
--- lib/Apache/compat.pm	23 Nov 2002 22:35:06 -0000	1.71
+++ lib/Apache/compat.pm	28 Nov 2002 16:52:49 -0000
@@ -509,5 +509,80 @@
      APR::Table::make($r->pool, $nelts);
  }

+package Apache::MyConfig;
+
+use Apache::Build ();
+
+use constant WIN32 => Apache::Build::WIN32;
+
+our %Setup;
+
+my $build = Apache::Build->new();
+
+my $XXX = "Need to figure out";
+my $LEGACY = '';
+
+%Setup = (
+    APACHE_SRC         => $build->MP_AP_PREFIX, # can be not source
+    SSL_BASE           => $LEGACY,
+    APXS               => $build->apxs,
+    PERL_USELARGEFILES => $XXX, # XXX
+    PERL_TRACE         => $build->MP_TRACE,
+    PERL_DEBUG         => $build->MP_debug,
+    APACI_ARGS         => $LEGACY,
+    APACHE_PREFIX      => $build->MP_AP_PREFIX,
+    DO_HTTPD           => 1, # always DO_HTTPD
+    NO_HTTPD           => 0, # always DO_HTTPD
+    PREP_HTTPD         => 0, # always DO_HTTPD
+    USE_APACI          => 0, # no more
+    APACHE_HEADER_INSTALL   => 1, #
+    PERL_STATIC_EXTS   => $XXX,
+    PERL_SSI           => 0, # legacy
+    USE_APXS           => $XXX, # only for non-win?
+);
+
+my @callback_hooks = qw{
+    PERL_DISPATCH
+    PERL_CHILD_INIT
+    PERL_CHILD_EXIT
+    PERL_POST_READ_REQUEST
+    PERL_TRANS
+    PERL_HEADER_PARSER
+    PERL_ACCESS
+    PERL_AUTHEN PERL_AUTHZ
+    PERL_TYPE
+    PERL_FIXUP
+    PERL_HANDLER
+    PERL_LOG
+    PERL_INIT
+    PERL_CLEANUP
+    PERL_RESTART
+    PERL_STACKED_HANDLERS
+    PERL_METHOD_HANDLERS
+    PERL_DIRECTIVE_HANDLERS
+    PERL_TABLE_API
+    PERL_LOG_API
+    PERL_URI_API
+    PERL_UTIL_API
+    PERL_FILE_API
+    PERL_CONNECTION_API
+    PERL_SERVER_API
+    PERL_SECTIONS
+};
+
+# we have all the APIs available, just need to load their modules
+$Setup{$_} = 1 for @callback_hooks;
+
+if (WIN32) {
+    $Setup{APACHE_INC}  = $build->{APXS_INCLUDEDIR};
+    $Setup{APACHE_LIB}  = $XXX;
+    $Setup{MODPERL_INC} = $build->{MODPERL_INC};
+    $Setup{MODPERL_LIB} = $XXX; # win32 lib?
+}
+
+# need this alias for Apache::src backwards compat
+$Setup{Apache_Src} = $Setup{APACHE_SRC};
+
+
  1;
  __END__


__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Mime
View raw message