You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Fred Moyer <fr...@taperfriendlymusic.org> on 2004/08/08 19:15:38 UTC

[mp2] $r->method and $r->method_number set methods deprecated?

Greetings,

I use a CPAN module in my code that uses $r->method and $r->method_number
to set the request method and method numbers.  When I upgraded to
1.99_15-dev the module can no longer set the method and number, only get
it (1).  Are the set methods are deprecated, or are they in the works
still?  If they are deprecated I will refactor the module for 1.99_15.

Thanks for your time,

Fred

(1)
Existing code for reference which works under 1.99_14 but not 1.99_15:

sub _convert_to_get {
    ...
    $r->method('GET');
    $r->method_number(M_GET);
    ...
}

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: [mp2] $r->method and $r->method_number set methods deprecated?

Posted by Stas Bekman <st...@stason.org>.
Fred Moyer wrote:
>>Thanks for the spot Fred.
>>
>>The issue was is that we had almost all accessors settable, as I worked
> 
> through those I've made of them read-only, which wasn't always right.
> Please try the current cvs or the patch below [1].
> 
> Current cvs did the trick, thanks.

:)

>>Now if you could go through the mp2 accessors and check if I've missed
> 
> some other (and which should be read/write), that would be a lot of help.
> It's probably the easiest if you use the pod manpages from here:
> http://perl.apache.org/download/docs.html
> 
>>The mp1 methods are documented here:
>>modperl-docs/src/docs/1.0/api/Apache.pod
>>
>>The corresponding mp2 methods will be here:
>>modperl-docs/src/docs/2.0/api/Apache/*
> 
> 
> Sure I can do that no problem.  Will probably add tests to the TestAPI
> packages to determine if any other read/write accessors missing unless
> there is a more efficient way that I'm not seeing here.

No, Fred, we don't want just any accessors to be settable, only those 
that make sense and those that were settable in mp1, if things haven't 
changed in Apache2.

More tests is always good, but if looking at the manpages:
modperl-docs/src/docs/2.0/api/Apache/*
is not good, for a few structures accessors you can check:

   modperl-2.0/xs/maps/apache_structures

accessors starting with < are read-only.

for the complete mapping legend see %ModPerl::MapUtil::disabled_map in
modperl-2.0/lib/ModPerl/MapUtil.pm

Thanks.

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

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: [mp2] $r->method and $r->method_number set methods deprecated?

Posted by Fred Moyer <fr...@taperfriendlymusic.org>.
> Thanks for the spot Fred.
>
> The issue was is that we had almost all accessors settable, as I worked
through those I've made of them read-only, which wasn't always right.
Please try the current cvs or the patch below [1].

Current cvs did the trick, thanks.

> Now if you could go through the mp2 accessors and check if I've missed
some other (and which should be read/write), that would be a lot of help.
It's probably the easiest if you use the pod manpages from here:
http://perl.apache.org/download/docs.html
>
> The mp1 methods are documented here:
> modperl-docs/src/docs/1.0/api/Apache.pod
>
> The corresponding mp2 methods will be here:
> modperl-docs/src/docs/2.0/api/Apache/*

Sure I can do that no problem.  Will probably add tests to the TestAPI
packages to determine if any other read/write accessors missing unless
there is a more efficient way that I'm not seeing here.

>
> Thanks.

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: [mp2] $r->method and $r->method_number set methods deprecated?

Posted by Stas Bekman <st...@stason.org>.
Fred Moyer wrote:
> Greetings,
> 
> I use a CPAN module in my code that uses $r->method and $r->method_number
> to set the request method and method numbers.  When I upgraded to
> 1.99_15-dev the module can no longer set the method and number, only get
> it (1).  Are the set methods are deprecated, or are they in the works
> still?  If they are deprecated I will refactor the module for 1.99_15.
> 
> Thanks for your time,
> 
> Fred
> 
> (1)
> Existing code for reference which works under 1.99_14 but not 1.99_15:
> 
> sub _convert_to_get {
>     ...
>     $r->method('GET');
>     $r->method_number(M_GET);
>     ...
> }

Thanks for the spot Fred.

The issue was is that we had almost all accessors settable, as I worked 
through those I've made of them read-only, which wasn't always right. 
Please try the current cvs or the patch below [1].

Now if you could go through the mp2 accessors and check if I've missed 
some other (and which should be read/write), that would be a lot of 
help. It's probably the easiest if you use the pod manpages from here:
http://perl.apache.org/download/docs.html

The mp1 methods are documented here:
modperl-docs/src/docs/1.0/api/Apache.pod

The corresponding mp2 methods will be here:
modperl-docs/src/docs/2.0/api/Apache/*

Thanks.

[1] the patch:

Index: xs/maps/apache_structures.map
===================================================================
RCS file: /home/cvs/modperl-2.0/xs/maps/apache_structures.map,v
retrieving revision 1.35
diff -u -r1.35 apache_structures.map
--- xs/maps/apache_structures.map       2 Aug 2004 18:02:27 -0000       1.35
+++ xs/maps/apache_structures.map       8 Aug 2004 18:03:49 -0000
@@ -22,8 +22,8 @@
  <  request_time
     status_line
     status
-<  method
-<  method_number
+   method
+   method_number
     allowed
     allowed_xmethods
     allowed_methods


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

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html