Mailing List Archive

Apache::MyConfig hooks list
well, I did (very) little fooling around...

the small patch below allows you to do something like the following...

$ perl Makefile.PL PERL_FILE_API=1

and create a test:

use Apache::MyConfig;
die unless $Apache::MyConfig::Setup{PERL_FILE_API};


seems like a good place to start at least...

--Geoff

--- Makefile.PL.old Tue Oct 3 10:17:22 2000
+++ Makefile.PL Tue Oct 10 13:23:07 2000
@@ -1899,12 +1899,19 @@
#
# Configuartion for mod_perl and Apache::...
#
-package Apache::MyConfig ;
+package Apache::MyConfig;

%Setup = (
'Apache_Src' => \'$APACHE_SRC\',
'SSL_BASE' => \'$SSL_BASE\',
'APXS' => \'$WITH_APXS\',
+EOT
+
+ foreach my $key (sort @callback_hooks) {
+ print FH " \'$key\' => \'$callback_hooks{$key}\',\n";
+ }
+
+ print FH <<EOT;
);

1;

>
> I wasn't aware of Apache::MyConfig... we've talked before
> about being able
> to determine compiled in hooks without having to start a live
> server - are
> similar package variables a possible/good place to put stuff
> like this?
>
> --Geoff
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
> For additional commands, e-mail: dev-help@perl.apache.org
>
Re: Apache::MyConfig hooks list [ In reply to ]
On Tue, Oct 10, 2000 at 01:32:18PM -0400, Geoffrey Young wrote:
> --- Makefile.PL.old Tue Oct 3 10:17:22 2000
> +++ Makefile.PL Tue Oct 10 13:23:07 2000
> @@ -1899,12 +1899,19 @@
> #
> # Configuartion for mod_perl and Apache::...
> #
> -package Apache::MyConfig ;
> +package Apache::MyConfig;
>
> %Setup = (
> 'Apache_Src' => \'$APACHE_SRC\',
> 'SSL_BASE' => \'$SSL_BASE\',
> 'APXS' => \'$WITH_APXS\',


While we're on the subject, this has another problem: $WITH_APXS is
unset if we're building without APXS, even if we are building an apache
that supports it. Should that be fixed?

Dan

/--------------------------------\ /--------------------------------\
| Daniel Jacobowitz |__| SCS Class of 2002 |
| Debian GNU/Linux Developer __ Carnegie Mellon University |
| dan@debian.org | | dmj+@andrew.cmu.edu |
\--------------------------------/ \--------------------------------/
Re: Apache::MyConfig hooks list [ In reply to ]
On Tue, 10 Oct 2000, Geoffrey Young wrote:

> well, I did (very) little fooling around...
>
> the small patch below allows you to do something like the following...
>
> $ perl Makefile.PL PERL_FILE_API=1
>
> and create a test:
>
> use Apache::MyConfig;
> die unless $Apache::MyConfig::Setup{PERL_FILE_API};

whoops, this doesn't apply ontop of randy's patch that's in now. i'd be
happy to commit this in the morning if you want to make one against cvs.
thanks geoff.
RE: Apache::MyConfig hooks list [ In reply to ]
> -----Original Message-----
> From: Doug MacEachern [mailto:dougm@covalent.net]
> Sent: Wednesday, December 20, 2000 1:52 AM
> To: Geoffrey Young
> Cc: dev@perl.apache.org
> Subject: Re: Apache::MyConfig hooks list
>
>
> On Tue, 10 Oct 2000, Geoffrey Young wrote:
>
> > well, I did (very) little fooling around...
> >
> > the small patch below allows you to do something like the
> following...
> >
> > $ perl Makefile.PL PERL_FILE_API=1
> >
> > and create a test:
> >
> > use Apache::MyConfig;
> > die unless $Apache::MyConfig::Setup{PERL_FILE_API};
>
> whoops, this doesn't apply ontop of randy's patch that's in
> now. i'd be
> happy to commit this in the morning if you want to make one
> against cvs.
> thanks geoff.

this should work now - maybe Randy could check it just to make sure the
results are good on windows. looks fine to me, though...

you want me to insert some pod for Apache::MyConfig here too?

--- Makefile.PL.old Wed Dec 20 08:13:53 2000
+++ Makefile.PL Wed Dec 20 08:13:31 2000
@@ -1955,12 +1955,19 @@
#
# Configuration for mod_perl and Apache::...
#
-package Apache::MyConfig ;
+package Apache::MyConfig;

%Setup = (
'Apache_Src' => \'$APACHE_SRC\',
'SSL_BASE' => \'$SSL_BASE\',
'APXS' => \'$WITH_APXS\',
+EOT
+
+ foreach my $key (sort @callback_hooks) {
+ print FH " \'$key\' => \'$callback_hooks{$key}\',\n";
+ }
+
+ print FH <<EOT;
$string
);


>
RE: Apache::MyConfig hooks list [ In reply to ]
On Wed, 20 Dec 2000, Geoffrey Young wrote:

> this should work now - maybe Randy could check it just to make sure the
> results are good on windows. looks fine to me, though...

looks good, applied, thanks!

> you want me to insert some pod for Apache::MyConfig here too?

that would be cool.
RE: Apache::MyConfig hooks list [ In reply to ]
> -----Original Message-----
> From: Doug MacEachern [mailto:dougm@covalent.net]
> Sent: Wednesday, December 20, 2000 1:20 PM
> To: Geoffrey Young
> Cc: dev@perl.apache.org
> Subject: RE: Apache::MyConfig hooks list
>
> > you want me to insert some pod for Apache::MyConfig here too?
>
> that would be cool.

well, it's not much but I wasn't sure if you wanted a huge pod in
Makefile.PL anyway...

for the life of me I can't figure out how to add MyConfig.pm to MAN3POD -
explicity adding it truncates everything else, but manifypods() doesn't see
it on its own..,

for what it's worth:

--- Makefile.PL.old Wed Dec 20 14:38:34 2000
+++ Makefile.PL Thu Dec 21 13:58:43 2000
@@ -1974,6 +1974,27 @@
1;

__END__
+
+=head1 NAME
+
+Apache::MyConfig - build options access
+
+=head1 SYNOPSIS
+
+ use Apache::MyConfig;
+ die unless \$Apache::MyConfig::Setup{PERL_FILE_API};
+
+=head1 DESCRIPTION
+
+B<Apache::MyConfig> module provides access to the various hooks
+and features set when mod_perl is built. This circumvents the
+need to set up a live server just to find out if a certain callback
+hook is available.
+
+Itterate through \%Apache::MyConfig::Setup to get obtain build
+information then see Appendix B of the Eagle book for more detail
+on each key.
+
EOT
close FH;


>
RE: Apache::MyConfig hooks list [ In reply to ]
On Thu, 21 Dec 2000, Geoffrey Young wrote:

> for the life of me I can't figure out how to add MyConfig.pm to MAN3POD -
> explicity adding it truncates everything else, but manifypods() doesn't see
> it on its own..,

weird. perldoc Apache::MyConfig works ok at least. applied, thanks!