Add means of optionally merging handlers from parent context into a child 
context.
----------------------------------------------------------------------------------

         Key: MODPYTHON-162
         URL: http://issues.apache.org/jira/browse/MODPYTHON-162
     Project: mod_python
        Type: New Feature

  Components: core  
    Reporter: Graham Dumpleton


Blantently stealing documentation from mod_perl, would be nice to have an 
equivalent to the following feature.



MergeHandlers

Turn on merging of Perl*Handler arrays. For example with a setting:

  PerlFixupHandler Apache2::FixupA
  
  <Location /inside>
      PerlFixupHandler Apache2::FixupB
  </Location>

a request for /inside only runs Apache2::FixupB (mod_perl 1.0 behavior). But 
with this configuration:

  PerlFixupHandler Apache2::FixupA
  
  <Location /inside>
      PerlOptions +MergeHandlers
      PerlFixupHandler Apache2::FixupB
  </Location>

a request for /inside will run both Apache2::FixupA and Apache2::FixupB 
handlers.



Currently mod_python behaves like mod_perl 1.0 in that specifing a handler in a 
child context will cause any handler for the same phase in a parent context to 
be totally ignored. In mod_perl 2.0, you can use the MergeHandlers option to 
say that list of handlers for a parent can be merged with those a of a parent 
context.

In mod_perl 2.0 it is an all or nothing affair. Ie., you cant say that you only 
want handlers for specific phases merged. It might be worth investigating 
whether it could be more flexible. For example:

  PythonFixupHandler FixupA
  
  <Location /inside>
      PythonMergeHandlers +PythonFixupHandler
      PythonFixupHandler FixupB
  </Location>

  <Location /inside/inside>
      PythonMergeHandlers -PythonFixupHandler
      PythonFixupHandler FixupC
  </Location>

Thus, if /, runs FixupA, if /inside, runs FixupA and FixupB. If /inside/inside, 
runs FixupC. Ie., '-' resets back to default of not merging with parent.



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to