I cannot compile with ZE2 any longer, due to this patch.
Apply to ZE2?
main/main.lo: In function `php_module_startup':
/usr/src/php4-HEAD/main/main.c:1195: undefined reference to
`zend_register_standard_ini_entries'
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1
marcus
At 14:26 17.11.2002, Zeev Suraski wrote:
zeevSun Nov 17 08:26:37 2002 EDT
Modified files:
/Zend zend.c zend.h zend_builtin_functions.c zend_execute.c
zend_execute_API.c
/php4/main main.c
Log:
Unify handling of error_reporting - fix bug #16137
Index: Zend/zend.c
diff -u Zend/zend.c:1.162 Zend/zend.c:1.163
--- Zend/zend.c:1.162 Fri Nov 1 17:19:55 2002
+++ Zend/zend.c Sun Nov 17 08:26:36 2002
@@ -59,6 +59,22 @@
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;
@@ -487,6 +503,14 @@
#endif
return SUCCESS;
+}
+
+
+void zend_register_standard_ini_entries(TSRMLS_D)
+{
+ int module_number = 0;
+
+ REGISTER_INI_ENTRIES();
}
Index: Zend/zend.h
diff -u Zend/zend.h:1.165 Zend/zend.h:1.166
--- Zend/zend.h:1.165 Thu Nov 14 00:41:32 2002
+++ Zend/zend.h Sun Nov 17 08:26:36 2002
@@ -17,7 +17,7 @@
+--+
*/
-/* $Id: zend.h,v 1.165 2002/11/14 05:41:32 sebastian Exp $ */
+/* $Id: zend.h,v 1.166 2002/11/17 13:26:36 zeev Exp $ */
#ifndef ZEND_H
#define ZEND_H
@@ -348,6 +348,7 @@
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);
Index: Zend/zend_builtin_functions.c
diff -u Zend/zend_builtin_functions.c:1.124
Zend/zend_builtin_functions.c:1.125
--- Zend/zend_builtin_functions.c:1.124 Mon Oct 21 04:42:32 2002
+++ Zend/zend_builtin_functions.c Sun Nov 17 08:26:37 2002
@@ -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);
@@ -398,8 +398,8 @@
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();
Index: Zend/zend_execute.c
diff -u Zend/zend_execute.c:1.316 Zend/zend_execute.c:1.317
--- Zend/zend_execute.c:1.316 Mon Nov 11 13:27:32 2002
+++ Zend/zend_execute.c Sun Nov 17 08:26:37 2002
@@ -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)
@@ -2424,10 +2425,16 @@
case ZEND_BEGIN_SILENCE:
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 */
- EG(error_reporting) = 0;
+ zend_alter_ini_entry("error_reporting",
sizeof("error_reporting"), "0", 1, ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME);
NEXT_OPCODE();
- case ZEND_END_SILENCE:
- EG(error_reporting) =
EX(Ts)[EX(opline)->op1.u.var].tmp_var.value.lval;
+ case ZEND_END_SILENCE: {
+ 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);
+ }