]> granicus.if.org Git - php/commitdiff
Fix PHPRC overriding other ini files. This is how PHPRC worked prior to
authorShane Caraveo <shane@php.net>
Sat, 22 Mar 2003 18:54:35 +0000 (18:54 +0000)
committerShane Caraveo <shane@php.net>
Sat, 22 Mar 2003 18:54:35 +0000 (18:54 +0000)
4.3.x, and is usefull for applications that execute PHP and want to
emulate CGI and define alternate INI files (ie. cannot use -c).

main/php_ini.c

index ccceb634880b641cb981dc1b80a4936665261949..2422392f9b051b9791cd9240cf115cf2b652d9b6 100644 (file)
@@ -306,6 +306,14 @@ int php_init_config()
                 * Prepare search path
                 */
 
+               /* Add environment location */
+               if (env_location[0]) {
+                       if (*php_ini_search_path) {
+                               strcat(php_ini_search_path, paths_separator);
+                       }
+                       strcat(php_ini_search_path, env_location);
+               }
+
                /* Add cwd */
 #ifdef INI_CHECK_CWD
                if (strcmp(sapi_module.name, "cli") != 0) {
@@ -343,14 +351,6 @@ int php_init_config()
                        efree(binary_location);
                }
 
-               /* Add environment location */
-               if (env_location[0]) {
-                       if (*php_ini_search_path) {
-                               strcat(php_ini_search_path, paths_separator);
-                       }
-                       strcat(php_ini_search_path, env_location);
-               }
-
                /* Add default location */
 #ifdef PHP_WIN32
                default_location = (char *) emalloc(MAXPATHLEN + 1);