On 28 Feb 2011, at 10:32 PM, Igor Galić wrote:
I think we discussed such possibilities last year at the retreat
but didn't really follow up on it, so lets assume it's a fresh new
idea which I just thought of :)
ap_read_config() passes the config file it gets more or less
directly to ap_pcfg_openfile() which again pass it more or less
directly to apr_file_open() -- now what if we wanted to place
our configuration files on a remote (HTTP ;) resource. Of course
it sounds silly to boot-strap an HTTP server from an HTTP server
but JBoss for instance supports that -- in part at least: For the
application's properties files.
I looked at this concept a number of years ago, and from the research
I did it's definitely possible.
Ultimately, we have a mechanism that produces lines, and each line is
fed into a parser that parses the config. Right now, that mechanism is
"open file, read it in line by line", but there is nothing stopping us
from making this pluggable.
The idea I had in mind was to teach the Include directive how to
support URLs, for example like this:
Include http://somewhere/something.conf
or something like this:
Include ldap://some-ldap-url
where the default is this:
Include file:///some-path
AKA
Include /some-path
All we would need to do to start would be to define a suitable hook to
consume the lines, and then refactor the existing file based code to
use the hook. At a later date, people can add implementations as and
when they see fit.
Regards,
Graham
--