For Programmers: Free Programming Magazines  


Home > Archive > PHP Zend Engine > September 2005 > cvs: ZendEngine2 / zend_ini.c









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author cvs: ZendEngine2 / zend_ini.c
Jani Taskinen

2005-09-02, 6:55 pm

sniper Fri Sep 2 17:08:11 2005 EDT

Modified files:
/ZendEngine2 zend_ini.c
Log:
MFB: - Fixed bug #34307. We were not calling on_modify handler to set the default
value in case setting the one from .ini file failed. (Andrei)


http://cvs.php.net/diff.php/ZendEng...40&r2=1.41&ty=u
Index: ZendEngine2/zend_ini.c
diff -u ZendEngine2/zend_ini.c:1.40 ZendEngine2/zend_ini.c:1.41
--- ZendEngine2/zend_ini.c:1.40 Thu Aug 11 19:34:57 2005
+++ ZendEngine2/zend_ini.c Fri Sep 2 17:08:11 2005
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/

-/* $Id: zend_ini.c,v 1.40 2005/08/11 23:34:57 andrei Exp $ */
+/* $Id: zend_ini.c,v 1.41 2005/09/02 21:08:11 sniper Exp $ */

#include "zend.h"
#include "zend_qsort.h"
@@ -155,6 +155,7 @@
zend_ini_entry *hashed_ini_entry;
zval default_value;
HashTable *directives = registered_zend_ini_directives;
+ zend_bool config_directive_success = 0;

#ifdef ZTS
/* if we are called during the request, eg: from dl(),
@@ -172,6 +173,7 @@

while (p->name) {
p->module_number = module_number;
+ config_directive_success = 0;
if (zend_hash_add(directives, p->name, p->name_length, p, sizeof(zend_ini_entry), (void **) &hashed_ini_entry)==FAILURE) {
zend_unregister_ini_entries(module_numbe
r TSRMLS_CC);
return FAILURE;
@@ -181,11 +183,12 @@
|| hashed_ini_entry->on_modify(hashed_ini_entry, default_value.value.str.val, default_value.value.str.len, hashed_ini_entry->mh_arg1, hashed_ini_entry->mh_arg2, hashed_ini_entry->mh_arg3, ZEND_INI_STAGE_STARTUP TSRMLS_CC)==SUCCESS) {
hashed_ini_entry->value = default_value.value.str.val;
hashed_ini_entry->value_length = default_value.value.str.len;
+ config_directive_success = 1;
}
- } else {
- if (hashed_ini_entry->on_modify) {
- hashed_ini_entry->on_modify(hashed_ini_entry, hashed_ini_entry->value, hashed_ini_entry->value_length, hashed_ini_entry->mh_arg1, hashed_ini_entry->mh_arg2, hashed_ini_entry->mh_arg3, ZEND_INI_STAGE_STARTUP TSRMLS_CC);
- }
+ }
+
+ if (!config_directive_success && hashed_ini_entry->on_modify) {
+ hashed_ini_entry->on_modify(hashed_ini_entry, hashed_ini_entry->value, hashed_ini_entry->value_length, hashed_ini_entry->mh_arg1, hashed_ini_entry->mh_arg2, hashed_ini_entry->mh_arg3, ZEND_INI_STAGE_STARTUP TSRMLS_CC);
}
p++;
}
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com