]> granicus.if.org Git - php/commitdiff
Move asp_tags and short_open_tag to the new php_ini mechanism
authorZeev Suraski <zeev@php.net>
Sat, 10 Apr 1999 11:22:18 +0000 (11:22 +0000)
committerZeev Suraski <zeev@php.net>
Sat, 10 Apr 1999 11:22:18 +0000 (11:22 +0000)
main/main.c
main/php_globals.h
mod_php3.c
mod_php3.h

index 862b6622cc021fd574943bd7932006f6900b702d..c57c6af3ebf733d2b16764e848df6dcdaeae6d08 100644 (file)
@@ -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;
index 9dc472cd701a5eb12406b3e7a9bad0cb7cd4f835..c2662d9dbd43345bb50f4318d79d448cd0c860c6 100644 (file)
@@ -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;
 };
 
 
index c14c2d4ba1c6c85f697952ece8ff076cafa57492..521d33ae6173bc8c82b707321a53ad3ea244e5ae 100644 (file)
@@ -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}
 };
 
index 15cbd25dac13c7fa8d565092c3d0773b51f8d33a..0ba6606258e076d7defd9118e7b2ff56ded46498 100644 (file)
@@ -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;