diff options
| author | Kalle Sommer Nielsen <kalle@php.net> | 2010-04-12 01:52:55 +0000 |
|---|---|---|
| committer | Kalle Sommer Nielsen <kalle@php.net> | 2010-04-12 01:52:55 +0000 |
| commit | 8087be61d025139ff97d3356ceacd2603b779754 (patch) | |
| tree | 0b55599767005e7b617206667835c36e50933cfc /main/main.c | |
| parent | 4da75af2f82fc34b37a93bc3b4a10d6ce87afbdb (diff) | |
| download | php-git-8087be61d025139ff97d3356ceacd2603b779754.tar.gz | |
* Changed the way removed ini directives are shown so its easier to add new ones
* Removed define_syslog_variables and its associated functions
Diffstat (limited to 'main/main.c')
| -rw-r--r-- | main/main.c | 62 |
1 files changed, 41 insertions, 21 deletions
diff --git a/main/main.c b/main/main.c index 79138df20a..92630c8a80 100644 --- a/main/main.c +++ b/main/main.c @@ -425,7 +425,6 @@ static PHP_INI_MH(OnChangeMailForceExtra) /* {{{ PHP_INI */ PHP_INI_BEGIN() - PHP_INI_ENTRY_EX("define_syslog_variables", "0", PHP_INI_ALL, NULL, php_ini_boolean_displayer_cb) PHP_INI_ENTRY_EX("highlight.bg", HL_BG_COLOR, PHP_INI_ALL, NULL, php_ini_color_displayer_cb) 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) @@ -2061,29 +2060,50 @@ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_mod /* Check for deprecated directives */ /* NOTE: If you add anything here, remember to add it also in Makefile.global! */ { - static const char *directives[] = { - "define_syslog_variables", - "register_globals", - "register_long_arrays", - "safe_mode", - "magic_quotes_gpc", - "magic_quotes_runtime", - "magic_quotes_sybase", - NULL + struct { + const long error_level; + const char *phrase; + const char *directives[7]; /* Remember to change this if the number of directives change */ + } directives[] = { + { + E_CORE_WARNING, + "Directive '%s' is deprecated in PHP 5.3 and greater", + { + "register_globals", + "register_long_arrays", + "safe_mode", + "magic_quotes_gpc", + "magic_quotes_runtime", + "magic_quotes_sybase", + NULL + } + }, + { + E_CORE_ERROR, + "Directive '%s' is no longer available in PHP", + { + "define_syslog_variables", + "zend.ze1_compatibility_mode", + NULL + } + } }; - const char **p = directives; - long val; - while (*p) { - if (cfg_get_long((char*)*p, &val) == SUCCESS && val) { - zend_error(E_WARNING, "Directive '%s' is deprecated in PHP 5.3 and greater", *p); - } - ++p; - } + unsigned int i; - /* This is not too nice, but since its the only one theres no need for extra stuff here */ - if (cfg_get_long("zend.ze1_compatibility_mode", &val) == SUCCESS && val) { - zend_error(E_ERROR, "zend.ze1_compatibility_mode is no longer supported in PHP 5.3 and greater"); + /* 2 = Count of deprecation structs */ + for (i = 0; i < 2; i++) { + const char **p = directives[i].directives; + + while(*p) { + long value; + + if (cfg_get_long((char*)*p, &value) == SUCCESS && value) { + zend_error(directives[i].error_level, directives[i].phrase, *p); + } + + ++p; + } } } |
