summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZeev Suraski <zeev@php.net>1999-04-10 11:22:18 +0000
committerZeev Suraski <zeev@php.net>1999-04-10 11:22:18 +0000
commit7685b44c4bc72e3074b8fa1a13ab88f54ce79623 (patch)
tree9dd40dc2a68e49591637641cd7bc8c86cba24b0d
parent7656c77c389f17d6cdce0ca54a9a1a066564e43a (diff)
downloadphp-git-7685b44c4bc72e3074b8fa1a13ab88f54ce79623.tar.gz
Move asp_tags and short_open_tag to the new php_ini mechanism
-rw-r--r--main/main.c25
-rw-r--r--main/php_globals.h3
-rw-r--r--mod_php3.c10
-rw-r--r--mod_php3.h2
4 files changed, 10 insertions, 30 deletions
diff --git a/main/main.c b/main/main.c
index 862b6622cc..c57c6af3eb 100644
--- a/main/main.c
+++ b/main/main.c
@@ -130,8 +130,8 @@ PHP_INI_MH(OnSetPrecision)
PHP_INI_BEGIN()
- PHP_INI_ENTRY("short_open_tag", "1", PHP_INI_ALL, NULL, NULL)
- PHP_INI_ENTRY("asp_tags", "0", PHP_INI_ALL, NULL, NULL)
+ PHP_INI_ENTRY("short_open_tag", "1", PHP_INI_ALL, OnUpdateInt, (void *) XtOffsetOf(php_core_globals, short_tags))
+ PHP_INI_ENTRY("asp_tags", "0", PHP_INI_ALL, OnUpdateInt, (void *) XtOffsetOf(php_core_globals, asp_tags))
PHP_INI_ENTRY("precision", "14", PHP_INI_ALL, OnSetPrecision, NULL)
PHP_INI_ENTRY("highlight.comment", HL_COMMENT_COLOR, PHP_INI_ALL, NULL, NULL)
@@ -775,12 +775,6 @@ static int php3_config_ini_startup(ELS_D)
php3_ini.doc_root = NULL;
}
}
- if (cfg_get_long("short_open_tag", &php3_ini.short_open_tag) == FAILURE) {
- php3_ini.short_open_tag = DEFAULT_SHORT_OPEN_TAG;
- }
- if (cfg_get_long("asp_tags", &php3_ini.asp_tags) == FAILURE) {
- php3_ini.asp_tags = 0;
- }
if (cfg_get_string("user_dir", &php3_ini.user_dir) == FAILURE) {
if ((temp = getenv("PHP_USER_DIR"))) {
php3_ini.user_dir = temp;
@@ -914,10 +908,7 @@ int php3_module_startup(CLS_D ELS_DC)
zuf.block_interruptions = BLOCK_INTERRUPTIONS;
zuf.unblock_interruptions = UNBLOCK_INTERRUPTIONS;
- zuv.short_tags = DEFAULT_SHORT_OPEN_TAG;
- zuv.asp_tags = 0;
-
- zend_startup(&zuf, &zuv, NULL);
+ zend_startup(&zuf, NULL);
#if HAVE_SETLOCALE
setlocale(LC_CTYPE, "");
@@ -938,19 +929,17 @@ int php3_module_startup(CLS_D ELS_DC)
le_index_ptr = _register_list_destructors(NULL, NULL, 0);
FREE_MUTEX(gLock);
-
-
- /* We cannot do the config starup until after all the above
- happens, otherwise loading modules from ini file breaks */
-#if !USE_SAPI
if (php3_config_ini_startup(ELS_C) == FAILURE) {
return FAILURE;
}
-#endif
php_ini_mstartup();
REGISTER_INI_ENTRIES();
+ zuv.short_tags = (unsigned char) PG(short_tags);
+ zuv.asp_tags = (unsigned char) PG(asp_tags);
+ zend_set_utility_values(&zuv);
+
if (module_startup_modules() == FAILURE) {
php3_printf("Unable to start modules\n");
return FAILURE;
diff --git a/main/php_globals.h b/main/php_globals.h
index 9dc472cd70..c2662d9dbd 100644
--- a/main/php_globals.h
+++ b/main/php_globals.h
@@ -25,6 +25,9 @@ struct _php_core_globals {
long magic_quotes_gpc;
long magic_quotes_runtime;
long magic_quotes_sybase;
+
+ long asp_tags;
+ long short_tags;
};
diff --git a/mod_php3.c b/mod_php3.c
index c14c2d4ba1..521d33ae61 100644
--- a/mod_php3.c
+++ b/mod_php3.c
@@ -320,7 +320,6 @@ static void *php3_merge_dir(pool *p, void *basev, void *addv)
if (add->upload_tmp_dir != orig.upload_tmp_dir) new->upload_tmp_dir = add->upload_tmp_dir;
if (add->upload_max_filesize != orig.upload_max_filesize) new->upload_max_filesize = add->upload_max_filesize;
if (add->extension_dir != orig.extension_dir) new->extension_dir = add->extension_dir;
- if (add->short_open_tag != orig.short_open_tag) new->short_open_tag = add->short_open_tag;
if (add->error_log != orig.error_log) new->error_log = add->error_log;
/* skip the highlight stuff */
if (add->sql_safe_mode != orig.sql_safe_mode) new->sql_safe_mode = add->sql_safe_mode;
@@ -336,7 +335,6 @@ static void *php3_merge_dir(pool *p, void *basev, void *addv)
if (add->error_append_string != orig.error_append_string) new->error_append_string = add->error_append_string;
if (add->open_basedir != orig.open_basedir) new->open_basedir = add->open_basedir;
if (add->enable_dl != orig.enable_dl) new->enable_dl = add->enable_dl;
- if (add->asp_tags != orig.asp_tags) new->asp_tags = add->asp_tags;
if (add->dav_script != orig.dav_script) new->dav_script = add->dav_script;
return new;
@@ -355,9 +353,6 @@ char *php3flaghandler(cmd_parms * cmd, php3_ini_structure * conf, int val)
case 0:
conf->track_errors = val;
break;
- case 3:
- conf->short_open_tag = val;
- break;
case 4:
conf->safe_mode = val;
break;
@@ -385,9 +380,6 @@ char *php3flaghandler(cmd_parms * cmd, php3_ini_structure * conf, int val)
case 13:
conf->enable_dl = val;
break;
- case 14:
- conf->asp_tags = val;
- break;
}
return NULL;
}
@@ -611,7 +603,6 @@ command_rec php3_commands[] =
"Lets PHP handle DAV requests by parsing this script."},
#endif
{"php3_track_errors", php3flaghandler, (void *)0, OR_OPTIONS, FLAG, "on|off"},
- {"php3_short_open_tag", php3flaghandler, (void *)3, OR_OPTIONS, FLAG, "on|off"},
{"php3_safe_mode", php3flaghandler, (void *)4, ACCESS_CONF|RSRC_CONF, FLAG, "on|off"},
{"php3_track_vars", php3flaghandler, (void *)5, OR_OPTIONS, FLAG, "on|off"},
{"php3_sql_safe_mode", php3flaghandler, (void *)6, ACCESS_CONF|RSRC_CONF, FLAG, "on|off"},
@@ -621,7 +612,6 @@ command_rec php3_commands[] =
{"php3_log_errors", php3flaghandler, (void *)10, OR_OPTIONS, FLAG, "on|off"},
{"php3_display_errors", php3flaghandler, (void *)11, OR_OPTIONS, FLAG, "on|off"},
{"php3_enable_dl", php3flaghandler, (void *)13, RSRC_CONF|ACCESS_CONF, FLAG, "on|off"},
- {"php3_asp_tags", php3flaghandler, (void *)14, OR_OPTIONS, FLAG, "on|off"},
{NULL}
};
diff --git a/mod_php3.h b/mod_php3.h
index 15cbd25dac..0ba6606258 100644
--- a/mod_php3.h
+++ b/mod_php3.h
@@ -60,8 +60,6 @@ typedef struct {
char *upload_tmp_dir;
long upload_max_filesize;
char *extension_dir;
- long short_open_tag;
- long asp_tags;
char *error_log;
long sql_safe_mode;
long xbithack;