static int (*zend_get_configuration_directive_p)(char *name, uint name_length, zval *contents);
+static ZEND_INI_MH(OnUpdateErrorReporting)
+{
+ if (!new_value) {
+ EG(error_reporting) = E_ALL & ~E_NOTICE;
+ } else {
+ EG(error_reporting) = atoi(new_value);
+ }
+ return SUCCESS;
+}
+
+
+ZEND_INI_BEGIN()
+ ZEND_INI_ENTRY("error_reporting", NULL, ZEND_INI_ALL, OnUpdateErrorReporting)
+ZEND_INI_END()
+
+
#ifdef ZTS
ZEND_API int compiler_globals_id;
ZEND_API int executor_globals_id;
}
+void zend_register_standard_ini_entries(TSRMLS_D)
+{
+ int module_number = 0;
+
+ REGISTER_INI_ENTRIES();
+}
+
+
#ifdef ZTS
/* Unlink the global (r/o) copies of the class, function and constant tables,
* and use a fresh r/w copy for the startup thread
int zend_startup(zend_utility_functions *utility_functions, char **extensions, int start_builtin_functions);
void zend_shutdown(TSRMLS_D);
+void zend_register_standard_ini_entries(TSRMLS_D);
#ifdef ZTS
void zend_post_startup(TSRMLS_D);
#include "zend_API.h"
#include "zend_builtin_functions.h"
#include "zend_constants.h"
-
+#include "zend_ini.h"
#undef ZEND_TEST_EXCEPTIONS
static ZEND_FUNCTION(zend_version);
if (zend_get_parameters_ex(1, &arg) == FAILURE) {
RETURN_FALSE;
}
- convert_to_long_ex(arg);
- EG(error_reporting)=(*arg)->value.lval;
+ convert_to_string_ex(arg);
+ zend_alter_ini_entry("error_reporting", sizeof("error_reporting"), Z_STRVAL_PP(arg), Z_STRLEN_PP(arg), ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME);
break;
default:
ZEND_WRONG_PARAM_COUNT();
#include "zend_extensions.h"
#include "zend_fast_cache.h"
#include "zend_execute_locks.h"
+#include "zend_ini.h"
#define get_zval_ptr(node, Ts, should_free, type) _get_zval_ptr(node, Ts, should_free TSRMLS_CC)
#define get_zval_ptr_ptr(node, Ts, type) _get_zval_ptr_ptr(node, Ts TSRMLS_CC)
int zend_begin_silence_handler(ZEND_OPCODE_HANDLER_ARGS)
{
- EX_T(EX(opline)->result.u.var).tmp_var.value.lval = EG(error_reporting);
- EX_T(EX(opline)->result.u.var).tmp_var.type = IS_LONG; /* shouldn't be necessary */
- EG(error_reporting) = 0;
+ EX(Ts)[EX(opline)->result.u.var].tmp_var.value.lval = EG(error_reporting);
+ EX(Ts)[EX(opline)->result.u.var].tmp_var.type = IS_LONG; /* shouldn't be necessary */
+ zend_alter_ini_entry("error_reporting", sizeof("error_reporting"), "0", 1, ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME);
NEXT_OPCODE();
}
int zend_end_silence_handler(ZEND_OPCODE_HANDLER_ARGS)
{
- EG(error_reporting) = EX_T(EX(opline)->op1.u.var).tmp_var.value.lval;
- NEXT_OPCODE();
+ zval restored_error_reporting;
+
+ restored_error_reporting.type = IS_LONG;
+ restored_error_reporting.value.lval = EX(Ts)[EX(opline)->op1.u.var].tmp_var.value.lval;
+ 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);
+ zendi_zval_dtor(restored_error_reporting);
}
int zend_qm_assign_handler(ZEND_OPCODE_HANDLER_ARGS)
zend_ptr_stack_init(&EG(user_error_handlers));
zend_ptr_stack_init(&EG(user_exception_handlers));
- EG(orig_error_reporting) = EG(error_reporting);
zend_objects_store_init(&EG(objects_store), 1024);
EG(full_tables_cleanup) = 0;
zend_ptr_stack_clean(&EG(user_exception_handlers), ZVAL_DESTRUCTOR, 1);
zend_ptr_stack_destroy(&EG(user_exception_handlers));
- EG(error_reporting) = EG(orig_error_reporting);
zend_objects_store_destroy(&EG(objects_store));
} zend_end_try();
}