> > Is there a generic solution for SAPIs? > > The stuff is pretty generic, just check how it's done for > sapi/cgi/cgi_main.c in > function sapi_cgi_activate(). (IIRC :) > > I think I even put some comments in there..
Yes, looks good. Even the host-based config could be enabled by NSAPI. The code looks very generic and could be put directly into a generic SAPI function that runs after register_variables. You only need then _SERVER['DOCUMENT_ROOT'] (the length) and the script filename and HTTP_HOST/SERVER_NAME which is registered by every SAPI. One problem is in the per dir user config code: If one maps an alias for a directory containing the PHP scripts into his webserver config, the document root may not be a substring of the script file name, which would be a problem for the user config loading algorithm... You put the code into activate, but it may also be possible to do all this in the request startup I think...? I think we should discuss this in an extra thread. I would be happy to help with a generic solution (e.g. before script startup) and would help in implementing it! Uwe -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php