sapi/nsapi.c includes logic - nsapi_php_ini_entries() - for populating
PHP's ini table with key/value pairs from Web Server's obj.conf file.
This processing is unnecessary overhead for those Web Server
configuration where the obj.conf files only contain standard Web
Server pblock entries which aren't converted into php.ini entries.

Please review the attached patch which adds an optional magnus.conf
configuration directive that can be used to skip processing of
obj.conf pblock params for php.ini modifications.

thanks,
arvi
diff -r 618f279797ac sapi/nsapi/nsapi.c
--- a/sapi/nsapi/nsapi.c        Thu Aug 27 17:32:21 2009 +0530
+++ b/sapi/nsapi/nsapi.c        Thu Aug 27 18:00:18 2009 +0530
@@ -123,6 +123,9 @@
 
 /* this parameters to "Service"/"Error" are NSAPI ones which should not be 
php.ini keys and are excluded */
 static char *nsapi_exclude_from_ini_entries[] = { "fn", "type", "method", 
"directive", "code", "reason", "script", "bucket", NULL };
+
+/* specifies whether the PHP directives in obj.conf contain pblock params that 
need to be populated as php.ini entries */
+static int nsapi_php_ini = 1;
 
 static void nsapi_free(void *addr)
 {
@@ -915,6 +918,11 @@
        }
 #endif 
 
+       /* check if PHP ini processing for obj.conf directives can be skipped */
+       if (strval = pblock_findval("skip_nsapi_php_ini", pb)) {
+               nsapi_php_ini = 0;
+       }
+
        /* start SAPI */
        sapi_startup(&nsapi_sapi_module);
        nsapi_sapi_module.startup(&nsapi_sapi_module);
@@ -1008,7 +1016,9 @@
        SG(request_info).content_length = (content_length == NULL) ? 0 : 
strtoul(content_length, 0, 0);
        SG(sapi_headers).http_response_code = (error_directive) ? 
rq->status_num : 200;
        
-       nsapi_php_ini_entries(NSLS_C TSRMLS_CC);
+       if (nsapi_php_ini) {
+               nsapi_php_ini_entries(NSLS_C TSRMLS_CC);
+       }
 
        php_handle_auth_data(pblock_findval("authorization", rq->headers) 
TSRMLS_CC);
 
-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to