From: Shane Caraveo Date: Sat, 22 Mar 2003 18:54:35 +0000 (+0000) Subject: Fix PHPRC overriding other ini files. This is how PHPRC worked prior to X-Git-Tag: RELEASE_0_5~384 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=26296130ad33faf25b920b4d07ecefd954bb266b;p=php Fix PHPRC overriding other ini files. This is how PHPRC worked prior to 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). --- diff --git a/main/php_ini.c b/main/php_ini.c index ccceb63488..2422392f9b 100644 --- a/main/php_ini.c +++ b/main/php_ini.c @@ -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);