Jim Gallacher wrote ..
> > If the settings are going to be a generic key/value like in
> > PythonOption, but only for purposes of the mod_python system itself,
> > maybe it should be called PythonSystemOption. Prefer PythonSystemOption
> > as "Module" is too confusing to me given you have both Apache modules
> > and Python modules and a module importer. 
> 
> Fair enough. PythonSystemOption is a better. The directive definition is
> such that it cannot be used in VirtualHost, Directory, Location and so
> on which should help emphasize that it's use in only for configuring
> mod_python.so initialization.
> 
> > Also wary of "Config" because
> > of confusion with "req.get_config()".
> 
> Except that PythonSystemOption just stuffs strings into
> server->module_config->directives table, which can be accessed via
> req.server.get_config(). I can't see any reason application code will
> ever need the settings PythonSystemOption might set, so it's not a big
> deal if it's not obvious from the name that the settings can be
> retrieved with get_config. I like the new name as it signals our 
> intention of how PythonSystemOption should be used. This name is also 
> consistent with PythonOption, which is a good idea.

I have a better option (pun intended). :-)

We do not need a new directive. Instead use existing "PythonOption"
directive. In the handler code for the directive, it can look at the
value of the "cmd_parms->path" and determine if it is being used outside
of all VirtualHost, Directory, Location, File directives, ie., at global
scope "path" will be NULL. If it is, then stick it in a table object associated
with the server level config for mod_python. This would then be accessible
as: "req.server.get_options()".

Because "PythonOption" as used now at global scope results in options
being seen in "req.get_options()", so that still works, we merge the server
options into the request one before overlaying it with the request specific
options.

In other words "req.get_options()" is just like now, but 
"req.server.get_options()"
becomes the subset of options which were defined at global server scope.

Anything used by mod_python itself would use a namespace prefix of
"mod_python." as discussed before. Eg.

  PythonOption mod_python.mutex_directory

Thus, existing directive is used and just needs to be stated that option is
only used if at global server scope.

Graham

Reply via email to