You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Stas Bekman <st...@stason.org> on 2004/08/23 20:26:44 UTC

[mp2] $Apache::Server::SaveConfig

I've noticed that the move from Apache::Server to Apache::ServerRec and 
ServerUtil is not complete. There are still references to Apache::Server 
in the code and docs. I'll take care of the other places, but there is 
$Apache::Server::SaveConfig:

./lib/Apache/PerlSections.pm:sub save       { return 
$Apache::Server::SaveConfig }
./lib/Apache/Status.pm:if ($Apache::Server::SaveConfig) {
./t/conf/extra.last.conf:$Apache::Server::SaveConfig = 1;
./t/conf/extra.last.conf:$Apache::Server::SaveConfig = 1;
./t/conf/extra.last.conf.in:$Apache::Server::SaveConfig = 1;
./t/conf/extra.last.conf.in:$Apache::Server::SaveConfig = 1;
./src/modules/perl/modperl_cmd.c:    get_sv("Apache::Server::SaveConfig", 
FALSE)
./docs/api/Apache/PerlSections.pod:=head2 C<$Apache::Server::SaveConfig>
./docs/api/Apache/PerlSections.pod:apache. To do that, use 
Apache::Server-E<gt>add_config("directive"),
./docs/user/intro/overview.pod:C<$Apache::Server::SaveConfig> variable can 
be set to save

It should probably be $Apache::ServerRec::SaveConfig? Or else?


-- 
__________________________________________________________________
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


Re: [mp2] $Apache::Server::SaveConfig

Posted by "Philippe M. Chiasson" <go...@ectoplasm.org>.

Geoffrey Young wrote:
>>>  $Apache::PerlSections::Strict
> 
> 
> whoops - that's gone now.  I guess I haven't sync'd my checkout in a while :)
> 
> 
>>>  $Apache::PerlSections::Save
>>
>>
>>+1!

+1 from me too, these configuration variables were 'ported' from mp1 to mp2
as is. And sticking them in $Apache::Server::** didn't make much sense.

>>
>>Good idea Geoff!
>>
>>and compat.pod to be updated :)
>>
> 
> 
> partial patch attached - I'm getting some failures in perldo.t that I can't
> figure out, but it's probably because I have no business messing around in
> gozerland ;)

Thanks for the patch Geoff, I'll sort it all out today!


> --Geoff
> 
> 
> ------------------------------------------------------------------------
> 
> Index: docs/api/Apache/PerlSections.pod
> ===================================================================
> RCS file: /home/cvs/modperl-docs/src/docs/2.0/api/Apache/PerlSections.pod,v
> retrieving revision 1.17
> diff -u -r1.17 PerlSections.pod
> --- docs/api/Apache/PerlSections.pod	15 Aug 2004 00:53:31 -0000	1.17
> +++ docs/api/Apache/PerlSections.pod	23 Aug 2004 19:46:56 -0000
> @@ -138,7 +138,7 @@
>  
>  
>  
> -=head2 C<$Apache::Server::SaveConfig>
> +=head2 C<$Apache::PerlSections::Save>
>  
>  By default, the namespace in which C<E<lt>Perl E<gt>> sections are
>  evaluated is cleared after each block closes. By setting it to a true
> Index: docs/user/intro/overview.pod
> ===================================================================
> RCS file: /home/cvs/modperl-docs/src/docs/2.0/user/intro/overview.pod,v
> retrieving revision 1.4
> diff -u -r1.4 overview.pod
> --- docs/user/intro/overview.pod	11 Apr 2003 02:24:37 -0000	1.4
> +++ docs/user/intro/overview.pod	23 Aug 2004 19:46:58 -0000
> @@ -269,7 +269,7 @@
>  there are two approaches.  A module can "subclass" directive handlers,
>  saving a copy of the data for itself, then returning B<DECLINE_CMD> so
>  the other modules are also handed the info.  Or, the
> -C<$Apache::Server::SaveConfig> variable can be set to save
> +C<$Apache::PerlSections::Save> variable can be set to save
>  E<lt>PerlE<gt> configuration in the C<%Apache::ReadConfig::>
>  namespace.  Both methods are rather kludgy, version 2.0 provides a
>  L<Perl interface to the Apache configuration
> Index: docs/user/porting/compat.pod
> ===================================================================
> RCS file: /home/cvs/modperl-docs/src/docs/2.0/user/porting/compat.pod,v
> retrieving revision 1.60
> diff -u -r1.60 compat.pod
> --- docs/user/porting/compat.pod	5 Aug 2004 17:17:15 -0000	1.60
> +++ docs/user/porting/compat.pod	23 Aug 2004 19:47:00 -0000
> @@ -92,6 +92,13 @@
>  can be used to trap errors and ignore them. In mod_perl 1, 'strict' was
>  somewhat of a misnomer.
>  
> +=head2 C<$Apache::Server::SaveConfig>
> +
> +C<$Apache::Server::SaveConfig> has been renamed to
> +C<$Apache::PerlSections::Save>.  see
> +C<L<E<lt>PerlE<gt>|docs::2.0::api::Apache::PerlSections>>
> +for more information on this global variable.
> +
>  =head2 Apache Configuration Customization
>  
>  mod_perl 2.0 has slightly changed the mechanism for L<adding custom
> Index: lib/Apache/PerlSections.pm
> ===================================================================
> RCS file: /home/cvs/modperl-2.0/lib/Apache/PerlSections.pm,v
> retrieving revision 1.6
> diff -u -r1.6 PerlSections.pm
> --- lib/Apache/PerlSections.pm	9 Aug 2004 00:17:05 -0000	1.6
> +++ lib/Apache/PerlSections.pm	23 Aug 2004 19:47:00 -0000
> @@ -39,7 +39,7 @@
>  sub package    { return shift->{'args'}->{'package'} }
>  
>  my @saved;
> -sub save       { return $Apache::Server::SaveConfig }
> +sub save       { return $Apache::PerlSections::Save }
>  sub saved      { return @saved }
>  
>  sub handler : method {
> Index: lib/Apache/Status.pm
> ===================================================================
> RCS file: /home/cvs/modperl-2.0/lib/Apache/Status.pm,v
> retrieving revision 1.27
> diff -u -r1.27 Status.pm
> --- lib/Apache/Status.pm	16 Jul 2004 01:10:45 -0000	1.27
> +++ lib/Apache/Status.pm	23 Aug 2004 19:47:00 -0000
> @@ -67,7 +67,7 @@
>  delete $status{'sig'} if IS_WIN32;
>  
>  # XXX: needs porting
> -if ($Apache::Server::SaveConfig) {
> +if ($Apache::PerlSections::Save) {
>      $status{"section_config"} = "Perl Section Configuration";
>  }
>  
> Index: src/modules/perl/modperl_cmd.c
> ===================================================================
> RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_cmd.c,v
> retrieving revision 1.63
> diff -u -r1.63 modperl_cmd.c
> --- src/modules/perl/modperl_cmd.c	7 Aug 2004 03:09:05 -0000	1.63
> +++ src/modules/perl/modperl_cmd.c	23 Aug 2004 19:47:02 -0000
> @@ -482,7 +482,7 @@
>  #define MP_DEFAULT_PERLSECTION_HANDLER "Apache::PerlSections"
>  #define MP_DEFAULT_PERLSECTION_PACKAGE "Apache::ReadConfig"
>  #define MP_PERLSECTIONS_SAVECONFIG_SV \
> -    get_sv("Apache::Server::SaveConfig", FALSE)
> +    get_sv("Apache::PerlSections::Save", FALSE)
>  
>  MP_CMD_SRV_DECLARE(perldo)
>  {
> Index: t/conf/extra.last.conf.in
> ===================================================================
> RCS file: /home/cvs/modperl-2.0/t/conf/extra.last.conf.in,v
> retrieving revision 1.23
> diff -u -r1.23 extra.last.conf.in
> --- t/conf/extra.last.conf.in	8 Aug 2004 23:50:48 -0000	1.23
> +++ t/conf/extra.last.conf.in	23 Aug 2004 19:47:02 -0000
> @@ -17,7 +17,7 @@
>  tie %Location, 'ModPerl::TestTiePerlSection';
>  $Location{'/tied'} = 'test_tied';
>  
> -$Apache::Server::SaveConfig = 1;
> +$Apache::PerlSections::Save = 1;
>  $Location{'/perl_sections_saved'} = {
>      'AuthName' => 'PerlSection',
>      };
> @@ -27,7 +27,7 @@
>  </Perl>
>  
>  <Perl >
> -$Apache::Server::SaveConfig = 1;
> +$Apache::PerlSections::Save = 1;
>  $TestDirective::perl::filename = __FILE__;
>  $TestDirective::perl::dollar_zero = $0;
>  $TestDirective::perl::line =  __LINE__;
> 
> 
> 
> ------------------------------------------------------------------------
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
> For additional commands, e-mail: dev-help@perl.apache.org

-- 
--------------------------------------------------------------------------------
Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5
http://gozer.ectoplasm.org/     F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5

Re: [mp2] $Apache::Server::SaveConfig

Posted by Geoffrey Young <ge...@modperlcookbook.org>.
> Can you report that failure --verbose ? Because I just applied your
> patch and:
> 
> $> ./t/TEST directive

> All tests successful.

I think I forgot to re-make after I missed one spot - it all looks fine for
me too (now).

--Geoff

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


Re: [mp2] $Apache::Server::SaveConfig

Posted by "Philippe M. Chiasson" <go...@ectoplasm.org>.

Geoffrey Young wrote:
>>>  $Apache::PerlSections::Strict
> 
> 
> whoops - that's gone now.  I guess I haven't sync'd my checkout in a while :)
> 
> 
>>>  $Apache::PerlSections::Save
>>
>>
>>+1!
>>
>>Good idea Geoff!
>>
>>and compat.pod to be updated :)
>>
> 
> 
> partial patch attached - I'm getting some failures in perldo.t that I can't
> figure out, but it's probably because I have no business messing around in
> gozerland ;)

Can you report that failure --verbose ? Because I just applied your patch and:

$> ./t/TEST directive
t/directive/cmdparms...........ok
t/directive/env................ok
t/directive/perl...............ok
t/directive/perldo.............ok
t/directive/perlloadmodule.....ok
t/directive/perlloadmodule2....ok
t/directive/perlloadmodule3....ok
t/directive/perlloadmodule4....ok
t/directive/perlloadmodule5....ok
t/directive/perlloadmodule6....ok
t/directive/perlmodule.........ok
t/directive/perlrequire........ok
t/directive/pod................ok
t/directive/setupenv...........ok
All tests successful.
Files=14, Tests=94, 71 wallclock secs (36.80 cusr + 22.96 csys = 59.76 CPU)
[warning] server localhost.localdomain:8529 shutdown

> --Geoff
> 
> 
> ------------------------------------------------------------------------
> 
> Index: docs/api/Apache/PerlSections.pod
> ===================================================================
> RCS file: /home/cvs/modperl-docs/src/docs/2.0/api/Apache/PerlSections.pod,v
> retrieving revision 1.17
> diff -u -r1.17 PerlSections.pod
> --- docs/api/Apache/PerlSections.pod	15 Aug 2004 00:53:31 -0000	1.17
> +++ docs/api/Apache/PerlSections.pod	23 Aug 2004 19:46:56 -0000
> @@ -138,7 +138,7 @@
>  
>  
>  
> -=head2 C<$Apache::Server::SaveConfig>
> +=head2 C<$Apache::PerlSections::Save>
>  
>  By default, the namespace in which C<E<lt>Perl E<gt>> sections are
>  evaluated is cleared after each block closes. By setting it to a true
> Index: docs/user/intro/overview.pod
> ===================================================================
> RCS file: /home/cvs/modperl-docs/src/docs/2.0/user/intro/overview.pod,v
> retrieving revision 1.4
> diff -u -r1.4 overview.pod
> --- docs/user/intro/overview.pod	11 Apr 2003 02:24:37 -0000	1.4
> +++ docs/user/intro/overview.pod	23 Aug 2004 19:46:58 -0000
> @@ -269,7 +269,7 @@
>  there are two approaches.  A module can "subclass" directive handlers,
>  saving a copy of the data for itself, then returning B<DECLINE_CMD> so
>  the other modules are also handed the info.  Or, the
> -C<$Apache::Server::SaveConfig> variable can be set to save
> +C<$Apache::PerlSections::Save> variable can be set to save
>  E<lt>PerlE<gt> configuration in the C<%Apache::ReadConfig::>
>  namespace.  Both methods are rather kludgy, version 2.0 provides a
>  L<Perl interface to the Apache configuration
> Index: docs/user/porting/compat.pod
> ===================================================================
> RCS file: /home/cvs/modperl-docs/src/docs/2.0/user/porting/compat.pod,v
> retrieving revision 1.60
> diff -u -r1.60 compat.pod
> --- docs/user/porting/compat.pod	5 Aug 2004 17:17:15 -0000	1.60
> +++ docs/user/porting/compat.pod	23 Aug 2004 19:47:00 -0000
> @@ -92,6 +92,13 @@
>  can be used to trap errors and ignore them. In mod_perl 1, 'strict' was
>  somewhat of a misnomer.
>  
> +=head2 C<$Apache::Server::SaveConfig>
> +
> +C<$Apache::Server::SaveConfig> has been renamed to
> +C<$Apache::PerlSections::Save>.  see
> +C<L<E<lt>PerlE<gt>|docs::2.0::api::Apache::PerlSections>>
> +for more information on this global variable.
> +
>  =head2 Apache Configuration Customization
>  
>  mod_perl 2.0 has slightly changed the mechanism for L<adding custom
> Index: lib/Apache/PerlSections.pm
> ===================================================================
> RCS file: /home/cvs/modperl-2.0/lib/Apache/PerlSections.pm,v
> retrieving revision 1.6
> diff -u -r1.6 PerlSections.pm
> --- lib/Apache/PerlSections.pm	9 Aug 2004 00:17:05 -0000	1.6
> +++ lib/Apache/PerlSections.pm	23 Aug 2004 19:47:00 -0000
> @@ -39,7 +39,7 @@
>  sub package    { return shift->{'args'}->{'package'} }
>  
>  my @saved;
> -sub save       { return $Apache::Server::SaveConfig }
> +sub save       { return $Apache::PerlSections::Save }
>  sub saved      { return @saved }
>  
>  sub handler : method {
> Index: lib/Apache/Status.pm
> ===================================================================
> RCS file: /home/cvs/modperl-2.0/lib/Apache/Status.pm,v
> retrieving revision 1.27
> diff -u -r1.27 Status.pm
> --- lib/Apache/Status.pm	16 Jul 2004 01:10:45 -0000	1.27
> +++ lib/Apache/Status.pm	23 Aug 2004 19:47:00 -0000
> @@ -67,7 +67,7 @@
>  delete $status{'sig'} if IS_WIN32;
>  
>  # XXX: needs porting
> -if ($Apache::Server::SaveConfig) {
> +if ($Apache::PerlSections::Save) {
>      $status{"section_config"} = "Perl Section Configuration";
>  }
>  
> Index: src/modules/perl/modperl_cmd.c
> ===================================================================
> RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_cmd.c,v
> retrieving revision 1.63
> diff -u -r1.63 modperl_cmd.c
> --- src/modules/perl/modperl_cmd.c	7 Aug 2004 03:09:05 -0000	1.63
> +++ src/modules/perl/modperl_cmd.c	23 Aug 2004 19:47:02 -0000
> @@ -482,7 +482,7 @@
>  #define MP_DEFAULT_PERLSECTION_HANDLER "Apache::PerlSections"
>  #define MP_DEFAULT_PERLSECTION_PACKAGE "Apache::ReadConfig"
>  #define MP_PERLSECTIONS_SAVECONFIG_SV \
> -    get_sv("Apache::Server::SaveConfig", FALSE)
> +    get_sv("Apache::PerlSections::Save", FALSE)
>  
>  MP_CMD_SRV_DECLARE(perldo)
>  {
> Index: t/conf/extra.last.conf.in
> ===================================================================
> RCS file: /home/cvs/modperl-2.0/t/conf/extra.last.conf.in,v
> retrieving revision 1.23
> diff -u -r1.23 extra.last.conf.in
> --- t/conf/extra.last.conf.in	8 Aug 2004 23:50:48 -0000	1.23
> +++ t/conf/extra.last.conf.in	23 Aug 2004 19:47:02 -0000
> @@ -17,7 +17,7 @@
>  tie %Location, 'ModPerl::TestTiePerlSection';
>  $Location{'/tied'} = 'test_tied';
>  
> -$Apache::Server::SaveConfig = 1;
> +$Apache::PerlSections::Save = 1;
>  $Location{'/perl_sections_saved'} = {
>      'AuthName' => 'PerlSection',
>      };
> @@ -27,7 +27,7 @@
>  </Perl>
>  
>  <Perl >
> -$Apache::Server::SaveConfig = 1;
> +$Apache::PerlSections::Save = 1;
>  $TestDirective::perl::filename = __FILE__;
>  $TestDirective::perl::dollar_zero = $0;
>  $TestDirective::perl::line =  __LINE__;
> 
> 
> 
> ------------------------------------------------------------------------
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
> For additional commands, e-mail: dev-help@perl.apache.org

-- 
--------------------------------------------------------------------------------
Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5
http://gozer.ectoplasm.org/     F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5

Re: [mp2] $Apache::Server::SaveConfig

Posted by Geoffrey Young <ge...@modperlcookbook.org>.
>>   $Apache::PerlSections::Strict

whoops - that's gone now.  I guess I haven't sync'd my checkout in a while :)

>>   $Apache::PerlSections::Save
> 
> 
> +1!
> 
> Good idea Geoff!
> 
> and compat.pod to be updated :)
> 

partial patch attached - I'm getting some failures in perldo.t that I can't
figure out, but it's probably because I have no business messing around in
gozerland ;)

--Geoff

Re: [mp2] $Apache::Server::SaveConfig

Posted by Stas Bekman <st...@stason.org>.
Geoffrey Young wrote:
> 
> Stas Bekman wrote:
> 
>>I've noticed that the move from Apache::Server to Apache::ServerRec and
>>ServerUtil is not complete. There are still references to Apache::Server
>>in the code and docs. I'll take care of the other places, but there is
>>$Apache::Server::SaveConfig:
> 
> 
>>It should probably be $Apache::ServerRec::SaveConfig? Or else?
> 
> 
> both that and $Apache::Server::StrictPerlSections would probably be better
> placed in the Apache::PerlSections namespace, no?
> 
>   $Apache::PerlSections::Strict
>   $Apache::PerlSections::Save

+1!

Good idea Geoff!

and compat.pod to be updated :)

-- 
__________________________________________________________________
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


Re: [mp2] $Apache::Server::SaveConfig

Posted by Geoffrey Young <ge...@modperlcookbook.org>.

Stas Bekman wrote:
> I've noticed that the move from Apache::Server to Apache::ServerRec and
> ServerUtil is not complete. There are still references to Apache::Server
> in the code and docs. I'll take care of the other places, but there is
> $Apache::Server::SaveConfig:

> It should probably be $Apache::ServerRec::SaveConfig? Or else?

both that and $Apache::Server::StrictPerlSections would probably be better
placed in the Apache::PerlSections namespace, no?

  $Apache::PerlSections::Strict
  $Apache::PerlSections::Save

?

--Geoff

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