|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2007-09-04 17:30 UTC] manuel at mausz dot at
Description: ------------ Below is a patch against htscanner cvs head which (mainly) adds a httpd emulation to the htscanner extension. This is achieved by reading the ini setting from a xml file. The xml file is based on apache's configuration and therefor supports virtualhosts, location/-match, directory/-match and file/-match directives. On request serveraddress, -port and -name, the current directory and url will be read, the xml parsed and the ini settings altered. To get better performance the xml document and already prepared directives get cached. In order to get the same result as apache, I've analysed and reimplemented apaches parsing methods. The only exception is the vhost handling, which is completely implemented from scratch. The httpd emulation also supports the php_admin_(flag|value) > php_(flag|value) "system". A command line conversion tool for apache13/apache2x can be found in the scripts-directory (Note: PHP4 support is intention). Second the patch removes the main-routine from RINIT and hooks into sapi_module.activate. Thus its possible to modify certain ini settings like output_handler, register_globals, etc... Third (and last) I've also fixed a few minor things like stripping quotes after reading from .htaccess and a few I don't remember any more. The patch has been tested on gentoo linux and freebsd with apache13/apache20 and mod_fastcgi/mod_fcgi. If permitted I'd like to further help you in fixing and supporting this extension/enhancement. Any comments/improvements are much appreciated. Reproduce code: --------------- Patch at http://manuel.mausz.at/coding/patches/pecl/htscanner/htscanner-0.9.0.patch PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 15:00:01 2025 UTC |
Build process is fixed by following patch, though i'm way too less knowledgeable to consider it a safe change - pls verify: diff -urN ht-patched/htscanner.c ht-fixed/htscanner.c --- ht-patched/htscanner.c 2007-09-15 16:52:59.596681277 +0200 +++ ht-fixed/htscanner.c 2007-09-15 16:53:31.807800814 +0200 @@ -946,7 +946,7 @@ } /* }}} */ -static int htscanner_main(TSRMLS_DC) /* {{{ */ +static int htscanner_main(TSRMLS_C) /* {{{ */ { char *doc_root; char cwd[MAXPATHLEN + 1]; @@ -1140,7 +1140,7 @@ php_cgi_sapi_activate(TSRMLS_C); } - htscanner_main(TSRMLS_CC); + htscanner_main(TSRMLS_C); return SUCCESS; }