mirror of
https://github.com/php/php-src.git
synced 2025-01-26 21:54:16 +08:00
MFZE1 - error_reporting fix
This commit is contained in:
parent
72f0be09c0
commit
4be862b02c
24
Zend/zend.c
24
Zend/zend.c
@ -58,6 +58,22 @@ static void (*zend_message_dispatcher_p)(long message, void *data);
|
||||
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;
|
||||
@ -508,6 +524,14 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions, i
|
||||
}
|
||||
|
||||
|
||||
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
|
||||
|
@ -396,6 +396,7 @@ typedef int (*zend_write_func_t)(const char *str, uint str_length);
|
||||
|
||||
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);
|
||||
|
@ -22,7 +22,7 @@
|
||||
#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);
|
||||
@ -408,8 +408,8 @@ ZEND_FUNCTION(error_reporting)
|
||||
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();
|
||||
|
@ -31,6 +31,7 @@
|
||||
#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)
|
||||
@ -3566,16 +3567,21 @@ int zend_exit_handler(ZEND_OPCODE_HANDLER_ARGS)
|
||||
|
||||
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)
|
||||
|
@ -162,7 +162,6 @@ void init_executor(TSRMLS_D)
|
||||
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;
|
||||
@ -251,7 +250,6 @@ void shutdown_executor(TSRMLS_D)
|
||||
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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user