]> granicus.if.org Git - php/commitdiff
- Fixed the rest of bug #41561 ( @ operator not working )
authorJani Taskinen <jani@php.net>
Fri, 7 Sep 2007 09:31:26 +0000 (09:31 +0000)
committerJani Taskinen <jani@php.net>
Fri, 7 Sep 2007 09:31:26 +0000 (09:31 +0000)
Zend/zend_ini.c
Zend/zend_ini.h
Zend/zend_vm_def.h
Zend/zend_vm_execute.h

index 86402e663ffc64de3c82d5ae7f9a97e53405eb6a..ff8ecbf2bdfb505fb67b30572dec8307cbbdcbe0 100644 (file)
@@ -233,7 +233,7 @@ ZEND_API void zend_ini_refresh_caches(int stage TSRMLS_DC) /* {{{ */
 /* }}} */
 #endif
 
-ZEND_API int zend_alter_ini_entry(char *name, uint name_length, char *new_value, uint new_value_length, int modify_type, int stage) /* {{{ */
+ZEND_API int zend_alter_ini_entry_ex(char *name, uint name_length, char *new_value, uint new_value_length, int modify_type, int stage, int force_change)
 {
        zend_ini_entry *ini_entry;
        char *duplicate;
@@ -247,8 +247,10 @@ ZEND_API int zend_alter_ini_entry(char *name, uint name_length, char *new_value,
                ini_entry->modifiable = ZEND_INI_SYSTEM;
        }
 
-       if (!(ini_entry->modifiable & modify_type)) {
-               return FAILURE;
+       if (!force_change) {
+               if (!(ini_entry->modifiable & modify_type)) {
+                       return FAILURE;
+               }
        }
 
        duplicate = estrndup(new_value, new_value_length);
index b32b2b991f986f4d86e7db4fe6a0efed1ff4e7e9..ce1607ed52fd7490ce8b83d127eb51c3b937b1d0 100644 (file)
@@ -95,7 +95,7 @@ ZEND_API void zend_ini_sort_entries(TSRMLS_D);
 ZEND_API int zend_register_ini_entries(zend_ini_entry *ini_entry, int module_number TSRMLS_DC);
 ZEND_API void zend_unregister_ini_entries(int module_number TSRMLS_DC);
 ZEND_API void zend_ini_refresh_caches(int stage TSRMLS_DC);
-ZEND_API int zend_alter_ini_entry(char *name, uint name_length, char *new_value, uint new_value_length, int modify_type, int stage);
+ZEND_API int zend_alter_ini_entry_ex(char *name, uint name_length, char *new_value, uint new_value_length, int modify_type, int stage, int force_change);
 ZEND_API int zend_restore_ini_entry(char *name, uint name_length, int stage);
 ZEND_API void display_ini_entries(zend_module_entry *module);
 
@@ -105,6 +105,9 @@ ZEND_API char *zend_ini_string(char *name, uint name_length, int orig);
 
 ZEND_API int zend_ini_register_displayer(char *name, uint name_length, void (*displayer)(zend_ini_entry *ini_entry, int type));
 
+#define zend_alter_ini_entry(name, name_length, new_value, new_value_length, modify_type, stage) \
+       zend_alter_ini_entry_ex(name, name_length, new_value, new_value_length, modify_type, stage, 0)
+
 ZEND_API ZEND_INI_DISP(zend_ini_boolean_displayer_cb);
 ZEND_API ZEND_INI_DISP(zend_ini_color_displayer_cb);
 ZEND_API ZEND_INI_DISP(display_link_numbers);
index 67a7baba300cb0b6fbca60d822363a60da72f3f4..cf8486bd9aef9a5b5803fe631ab142a55b7eccaf 100644 (file)
@@ -3830,7 +3830,7 @@ ZEND_VM_HANDLER(57, ZEND_BEGIN_SILENCE, ANY, ANY)
        }
 
        if (EG(error_reporting)) {
-               zend_alter_ini_entry("error_reporting", sizeof("error_reporting"), "0", 1, ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME);
+               zend_alter_ini_entry_ex("error_reporting", sizeof("error_reporting"), "0", 1, ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME, 1);
        }
        ZEND_VM_NEXT_OPCODE();
 }
@@ -3850,7 +3850,7 @@ ZEND_VM_HANDLER(58, ZEND_END_SILENCE, TMP, ANY)
                Z_TYPE(restored_error_reporting) = IS_LONG;
                Z_LVAL(restored_error_reporting) = Z_LVAL(EX_T(opline->op1.u.var).tmp_var);
                convert_to_string(&restored_error_reporting);
-               zend_alter_ini_entry("error_reporting", sizeof("error_reporting"), Z_STRVAL(restored_error_reporting), Z_STRLEN(restored_error_reporting), ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME);
+               zend_alter_ini_entry_ex("error_reporting", sizeof("error_reporting"), Z_STRVAL(restored_error_reporting), Z_STRLEN(restored_error_reporting), ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME, 1);
                zendi_zval_dtor(restored_error_reporting);
        }
        if (EX(old_error_reporting) == &EX_T(opline->op1.u.var).tmp_var) {
@@ -4062,7 +4062,7 @@ ZEND_VM_HANDLER(149, ZEND_HANDLE_EXCEPTION, ANY, ANY)
                Z_TYPE(restored_error_reporting) = IS_LONG;
                Z_LVAL(restored_error_reporting) = Z_LVAL_P(EX(old_error_reporting));
                convert_to_string(&restored_error_reporting);
-               zend_alter_ini_entry("error_reporting", sizeof("error_reporting"), Z_STRVAL(restored_error_reporting), Z_STRLEN(restored_error_reporting), ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME);
+               zend_alter_ini_entry_ex("error_reporting", sizeof("error_reporting"), Z_STRVAL(restored_error_reporting), Z_STRLEN(restored_error_reporting), ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME, 1);
                zendi_zval_dtor(restored_error_reporting);
        }
        EX(old_error_reporting) = NULL;
index bc1619c27aeb0232a27aeb622c72367571a2421e..41d6275748b61f275d3eda0d63e583d6dfe6bb01 100644 (file)
@@ -452,7 +452,7 @@ static int ZEND_BEGIN_SILENCE_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
        }
 
        if (EG(error_reporting)) {
-               zend_alter_ini_entry("error_reporting", sizeof("error_reporting"), "0", 1, ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME);
+               zend_alter_ini_entry_ex("error_reporting", sizeof("error_reporting"), "0", 1, ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME, 1);
        }
        ZEND_VM_NEXT_OPCODE();
 }
@@ -602,7 +602,7 @@ static int ZEND_HANDLE_EXCEPTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
                Z_TYPE(restored_error_reporting) = IS_LONG;
                Z_LVAL(restored_error_reporting) = Z_LVAL_P(EX(old_error_reporting));
                convert_to_string(&restored_error_reporting);
-               zend_alter_ini_entry("error_reporting", sizeof("error_reporting"), Z_STRVAL(restored_error_reporting), Z_STRLEN(restored_error_reporting), ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME);
+               zend_alter_ini_entry_ex("error_reporting", sizeof("error_reporting"), Z_STRVAL(restored_error_reporting), Z_STRLEN(restored_error_reporting), ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME, 1);
                zendi_zval_dtor(restored_error_reporting);
        }
        EX(old_error_reporting) = NULL;
@@ -5370,7 +5370,7 @@ static int ZEND_END_SILENCE_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
                Z_TYPE(restored_error_reporting) = IS_LONG;
                Z_LVAL(restored_error_reporting) = Z_LVAL(EX_T(opline->op1.u.var).tmp_var);
                convert_to_string(&restored_error_reporting);
-               zend_alter_ini_entry("error_reporting", sizeof("error_reporting"), Z_STRVAL(restored_error_reporting), Z_STRLEN(restored_error_reporting), ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME);
+               zend_alter_ini_entry_ex("error_reporting", sizeof("error_reporting"), Z_STRVAL(restored_error_reporting), Z_STRLEN(restored_error_reporting), ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME, 1);
                zendi_zval_dtor(restored_error_reporting);
        }
        if (EX(old_error_reporting) == &EX_T(opline->op1.u.var).tmp_var) {