summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main/main.c28
-rw-r--r--main/php_ini.c18
-rw-r--r--main/php_ini.h1
3 files changed, 33 insertions, 14 deletions
diff --git a/main/main.c b/main/main.c
index 9eded7ac24..690418cf27 100644
--- a/main/main.c
+++ b/main/main.c
@@ -171,10 +171,10 @@ static PHP_INI_MH(OnUpdateErrorReporting)
# define DEFAULT_SENDMAIL_PATH NULL
#endif
PHP_INI_BEGIN()
- STD_PHP_INI_BOOLEAN("short_open_tag", "1", PHP_INI_ALL, OnUpdateInt, short_tags, php_core_globals, core_globals)
- STD_PHP_INI_BOOLEAN("asp_tags", "0", PHP_INI_ALL, OnUpdateInt, asp_tags, php_core_globals, core_globals)
+ STD_PHP_INI_BOOLEAN("short_open_tag", "1", PHP_INI_ALL, OnUpdateBool, short_tags, php_core_globals, core_globals)
+ STD_PHP_INI_BOOLEAN("asp_tags", "0", PHP_INI_ALL, OnUpdateBool, asp_tags, php_core_globals, core_globals)
PHP_INI_ENTRY("precision", "14", PHP_INI_ALL, OnSetPrecision)
- STD_PHP_INI_BOOLEAN("output_buffering", "0", PHP_INI_PERDIR|PHP_INI_SYSTEM, OnUpdateInt, output_buffering, php_core_globals, core_globals)
+ STD_PHP_INI_BOOLEAN("output_buffering", "0", PHP_INI_PERDIR|PHP_INI_SYSTEM, OnUpdateBool, output_buffering, php_core_globals, core_globals)
PHP_INI_ENTRY_EX("highlight.comment", HL_COMMENT_COLOR, PHP_INI_ALL, NULL, php_ini_color_displayer_cb)
PHP_INI_ENTRY_EX("highlight.default", HL_DEFAULT_COLOR, PHP_INI_ALL, NULL, php_ini_color_displayer_cb)
@@ -183,14 +183,14 @@ PHP_INI_BEGIN()
PHP_INI_ENTRY_EX("highlight.bg", HL_BG_COLOR, PHP_INI_ALL, NULL, php_ini_color_displayer_cb)
PHP_INI_ENTRY_EX("highlight.keyword", HL_KEYWORD_COLOR, PHP_INI_ALL, NULL, php_ini_color_displayer_cb)
- STD_PHP_INI_BOOLEAN("magic_quotes_gpc", "1", PHP_INI_ALL, OnUpdateInt, magic_quotes_gpc, php_core_globals, core_globals)
- STD_PHP_INI_BOOLEAN("magic_quotes_runtime", "0", PHP_INI_ALL, OnUpdateInt, magic_quotes_runtime, php_core_globals, core_globals)
- STD_PHP_INI_BOOLEAN("magic_quotes_sybase", "0", PHP_INI_ALL, OnUpdateInt, magic_quotes_sybase, php_core_globals, core_globals)
+ STD_PHP_INI_BOOLEAN("magic_quotes_gpc", "1", PHP_INI_ALL, OnUpdateBool, magic_quotes_gpc, php_core_globals, core_globals)
+ STD_PHP_INI_BOOLEAN("magic_quotes_runtime", "0", PHP_INI_ALL, OnUpdateBool, magic_quotes_runtime, php_core_globals, core_globals)
+ STD_PHP_INI_BOOLEAN("magic_quotes_sybase", "0", PHP_INI_ALL, OnUpdateBool, magic_quotes_sybase, php_core_globals, core_globals)
- STD_PHP_INI_BOOLEAN("safe_mode", "0", PHP_INI_SYSTEM, OnUpdateInt, safe_mode, php_core_globals, core_globals)
- STD_PHP_INI_BOOLEAN("sql.safe_mode", "0", PHP_INI_SYSTEM, OnUpdateInt, sql_safe_mode, php_core_globals, core_globals)
+ STD_PHP_INI_BOOLEAN("safe_mode", "0", PHP_INI_SYSTEM, OnUpdateBool, safe_mode, php_core_globals, core_globals)
+ STD_PHP_INI_BOOLEAN("sql.safe_mode", "0", PHP_INI_SYSTEM, OnUpdateBool, sql_safe_mode, php_core_globals, core_globals)
STD_PHP_INI_ENTRY("safe_mode_exec_dir", "1", PHP_INI_SYSTEM, OnUpdateString, safe_mode_exec_dir, php_core_globals, core_globals)
- STD_PHP_INI_BOOLEAN("enable_dl", "1", PHP_INI_SYSTEM, OnUpdateInt, enable_dl, php_core_globals, core_globals)
+ STD_PHP_INI_BOOLEAN("enable_dl", "1", PHP_INI_SYSTEM, OnUpdateBool, enable_dl, php_core_globals, core_globals)
PHP_INI_ENTRY_EX("allow_builtin_links", "0", PHP_INI_ALL, NULL, php_ini_boolean_displayer_cb)
PHP_INI_ENTRY("SMTP", "localhost", PHP_INI_ALL, NULL)
@@ -198,16 +198,16 @@ PHP_INI_BEGIN()
PHP_INI_ENTRY("sendmail_from", NULL, PHP_INI_ALL, NULL)
PHP_INI_ENTRY("error_reporting", NULL, PHP_INI_ALL, OnUpdateErrorReporting)
- STD_PHP_INI_BOOLEAN("display_errors", "1", PHP_INI_ALL, OnUpdateInt, display_errors, php_core_globals, core_globals)
- STD_PHP_INI_BOOLEAN("track_errors", "0", PHP_INI_ALL, OnUpdateInt, track_errors, php_core_globals, core_globals)
- STD_PHP_INI_BOOLEAN("log_errors", "0", PHP_INI_ALL, OnUpdateInt, log_errors, php_core_globals, core_globals)
+ STD_PHP_INI_BOOLEAN("display_errors", "1", PHP_INI_ALL, OnUpdateBool, display_errors, php_core_globals, core_globals)
+ STD_PHP_INI_BOOLEAN("track_errors", "0", PHP_INI_ALL, OnUpdateBool, track_errors, php_core_globals, core_globals)
+ STD_PHP_INI_BOOLEAN("log_errors", "0", PHP_INI_ALL, OnUpdateBool, log_errors, php_core_globals, core_globals)
STD_PHP_INI_ENTRY("error_log", NULL, PHP_INI_ALL, OnUpdateString, error_log, php_core_globals, core_globals)
STD_PHP_INI_ENTRY("auto_prepend_file", NULL, PHP_INI_ALL, OnUpdateString, auto_prepend_file, php_core_globals, core_globals)
STD_PHP_INI_ENTRY("auto_append_file", NULL, PHP_INI_ALL, OnUpdateString, auto_append_file, php_core_globals, core_globals)
- STD_PHP_INI_BOOLEAN("y2k_compliance", "0", PHP_INI_ALL, OnUpdateInt, y2k_compliance, php_core_globals, core_globals)
+ STD_PHP_INI_BOOLEAN("y2k_compliance", "0", PHP_INI_ALL, OnUpdateBool, y2k_compliance, php_core_globals, core_globals)
STD_PHP_INI_ENTRY("doc_root", NULL, PHP_INI_SYSTEM, OnUpdateStringUnempty, doc_root, php_core_globals, core_globals)
STD_PHP_INI_ENTRY("user_dir", NULL, PHP_INI_SYSTEM, OnUpdateStringUnempty, user_dir, php_core_globals, core_globals)
@@ -225,7 +225,7 @@ PHP_INI_BEGIN()
PHP_INI_ENTRY("max_execution_time", "30", PHP_INI_ALL, OnChangeMaxExecutionTime)
PHP_INI_ENTRY("memory_limit", "8388608", PHP_INI_ALL, OnChangeMemoryLimit)
- STD_PHP_INI_BOOLEAN("track_vars", (PHP_TRACK_VARS?"1":"0"), PHP_INI_ALL, OnUpdateInt, track_vars, php_core_globals, core_globals)
+ STD_PHP_INI_BOOLEAN("track_vars", (PHP_TRACK_VARS?"1":"0"), PHP_INI_ALL, OnUpdateBool, track_vars, php_core_globals, core_globals)
STD_PHP_INI_ENTRY("gpc_order", "GPC", PHP_INI_ALL, OnUpdateStringUnempty, gpc_order, php_core_globals, core_globals)
STD_PHP_INI_ENTRY("arg_separator", "&", PHP_INI_ALL, OnUpdateStringUnempty, arg_separator, php_core_globals, core_globals)
STD_PHP_INI_BOOLEAN("ignore_user_abort", "1", PHP_INI_ALL, OnUpdateInt, ignore_user_abort, php_core_globals, core_globals)
diff --git a/main/php_ini.c b/main/php_ini.c
index bd73ef6b58..7848008652 100644
--- a/main/php_ini.c
+++ b/main/php_ini.c
@@ -366,6 +366,24 @@ PHPAPI void display_ini_entries(zend_module_entry *module)
/* Standard message handlers */
+PHPAPI PHP_INI_MH(OnUpdateBool)
+{
+ zend_bool *p;
+#ifndef ZTS
+ char *base = (char *) mh_arg2;
+#else
+ char *base;
+
+ base = (char *) ts_resource(*((int *) mh_arg2));
+#endif
+
+ p = (zend_bool *) (base+(size_t) mh_arg1);
+
+ *p = (zend_bool) atoi(new_value);
+ return SUCCESS;
+}
+
+
PHPAPI PHP_INI_MH(OnUpdateInt)
{
long *p;
diff --git a/main/php_ini.h b/main/php_ini.h
index 6ea9885ffc..339c4aa7ac 100644
--- a/main/php_ini.h
+++ b/main/php_ini.h
@@ -135,6 +135,7 @@ pval *cfg_get_entry(char *name, uint name_length);
/* Standard message handlers */
+PHPAPI PHP_INI_MH(OnUpdateBool);
PHPAPI PHP_INI_MH(OnUpdateInt);
PHPAPI PHP_INI_MH(OnUpdateReal);
PHPAPI PHP_INI_MH(OnUpdateString);