]> granicus.if.org Git - php/commitdiff
Thread safety patch. It works now with just-in-time resource initialization!
authorZeev Suraski <zeev@php.net>
Wed, 21 Apr 1999 17:28:54 +0000 (17:28 +0000)
committerZeev Suraski <zeev@php.net>
Wed, 21 Apr 1999 17:28:54 +0000 (17:28 +0000)
ext/standard/basic_functions.c
ext/standard/syslog.c
main/configuration-parser.y
main/main.c
main/php_ini.c
php4ts.dsw
testfunc

index 1417a87126c82651c88c138c32e9e3eaafff2f93..bf0a5da21ad9b0a1ddbe9fab1916c770791db5c4 100644 (file)
@@ -374,7 +374,7 @@ void test_class_startup();
 
 int php3_minit_basic(INIT_FUNC_ARGS)
 {
-       TLS_VARS;
+       ELS_FETCH();
 
        REGISTER_DOUBLE_CONSTANT("M_PI", M_PI, CONST_CS | CONST_PERSISTENT);
        test_class_startup();
@@ -2088,6 +2088,7 @@ PHP_FUNCTION(define)
        pval *var, *val, *non_cs;
        int case_sensitive;
        zend_constant c;
+       ELS_FETCH();
        
        switch(ARG_COUNT(ht)) {
                case 2:
@@ -2128,7 +2129,7 @@ PHP_FUNCTION(define)
        c.flags = case_sensitive | ~CONST_PERSISTENT; /* non persistent */
        c.name = php3_strndup(var->value.str.val, var->value.str.len);
        c.name_len = var->value.str.len+1;
-       zend_register_constant(&c);
+       zend_register_constant(&c ELS_CC);
        RETURN_TRUE;
 }
 
index 4581ed58dc080694dae30d6919e3a244f0e2ad46..662aa08cfb61fde55c394a5946927ba2287452c3 100644 (file)
@@ -57,7 +57,7 @@ static void start_syslog(void);
 
 int php3_minit_syslog(INIT_FUNC_ARGS)
 {
-       TLS_VARS;
+       ELS_FETCH();
        
        /* error levels */
        REGISTER_LONG_CONSTANT("LOG_EMERG", LOG_EMERG, CONST_CS | CONST_PERSISTENT); /* system unusable */
index f89987b63b5edaa66efb87c2fdb9db788c213dca..b54079d6e02e19ccd8fd43e3b02317c5f15b234f 100644 (file)
@@ -167,6 +167,7 @@ int php3_init_config(void)
        {
                char *env_location,*default_location,*php_ini_path;
                int safe_mode_state = PG(safe_mode);
+               char *open_basedir = PG(open_basedir);
                char *opened_path;
                int free_default_location=0;
                
@@ -209,12 +210,14 @@ int php3_init_config(void)
                        strcpy(php_ini_path,default_location);
                }
                PG(safe_mode) = 0;
+               PG(open_basedir) = NULL;
                cfgin = php3_fopen_with_path("php3.ini","r",php_ini_path,&opened_path);
                free(php_ini_path);
                if (free_default_location) {
                        free(default_location);
                }
                PG(safe_mode) = safe_mode_state;
+               PG(open_basedir) = open_basedir;
 
                if (!cfgin) {
 # if WIN32|WINNT
index db7f3f7a41ab816790539aed8f1da272636381c6..b46b261b8ad3bcf2886338d086b17ef0c78e1bc3 100644 (file)
@@ -1199,7 +1199,7 @@ static void php3_parse(zend_file_handle *primary_file CLS_DC ELS_DC PLS_DC)
        if (setjmp(EG(bailout))!=0) {
                return;
        }
-       _php3_hash_environment();
+       _php3_hash_environment(PLS_C);
 
 #if WIN32||WINNT
        UpdateIniFromRegistry(primary_file->filename);
index 406f5ac79b72886c8f74f8ae550548a40c5fa04e..a58c0ba9d9d21f55324c93050b9d3a8deac42ceb 100644 (file)
@@ -105,6 +105,9 @@ int php_register_ini_entries(php_ini_entry *ini_entry, int module_number)
                        php_unregister_ini_entries(module_number);
                        return FAILURE;
                }
+               if (hashed_ini_entry->on_modify) {
+                       hashed_ini_entry->on_modify(hashed_ini_entry, hashed_ini_entry->value, hashed_ini_entry->value_length, hashed_ini_entry->mh_arg);
+               }
                if ((default_value=cfg_get_entry(p->name, p->name_length))) {
                        if (!hashed_ini_entry->on_modify
                                || hashed_ini_entry->on_modify(hashed_ini_entry, default_value->value.str.val, default_value->value.str.len, hashed_ini_entry->mh_arg)==SUCCESS) {
index c198b2017aa7885c37d94d522b58bc1b036ada75..0cd8ad18623ca3d1c77b45fdc3a63df5d7005dce 100644 (file)
@@ -23,9 +23,6 @@ Package=<5>
 \r
 Package=<4>\r
 {{{\r
-    Begin Project Dependency\r
-    Project_Dep_Name TSRM\r
-    End Project Dependency\r
 }}}\r
 \r
 ###############################################################################\r
@@ -41,6 +38,9 @@ Package=<4>
     Begin Project Dependency\r
     Project_Dep_Name libzendts\r
     End Project Dependency\r
+    Begin Project Dependency\r
+    Project_Dep_Name TSRM\r
+    End Project Dependency\r
 }}}\r
 \r
 ###############################################################################\r
index cb55a66a6ff200ef6d79a1d779a9358efa6037a0..6c4775e54f746c5260714406174544c41c91ab4c 100644 (file)
--- a/testfunc
+++ b/testfunc
@@ -16,7 +16,7 @@ function bar()
        foo();
 }
 
-for ($i=0; $i<100000; $i++) {
+for ($i=0; $i<1000; $i++) {
        bar();
 }