cvs: php4 /main php_ini.c
| From: | Edin Kadribasic | Date: | Mon, 29 Jul 2002 12:17:34 +0000 |
| Subject: | cvs: php4 /main php_ini.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-13036@lists.php.net to get a copy of this message | ||
edink Mon Jul 29 08:17:34 2002 EDT
Modified files:
/php4/main php_ini.c
Log:
First try to open php-SAPI.ini and if it fails fall back to regular
php.ini file. For example cli version of PHP will first try to open
php-cli.ini in the usual ini file search path and only if it fails
will it try to open php.ini using the same path.
Index: php4/main/php_ini.c
diff -u php4/main/php_ini.c:1.95 php4/main/php_ini.c:1.96
--- php4/main/php_ini.c:1.95 Sun May 19 10:45:31 2002
+++ php4/main/php_ini.c Mon Jul 29 08:17:34 2002
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_ini.c,v 1.95 2002/05/19 14:45:31 sander Exp $ */
+/* $Id: php_ini.c,v 1.96 2002/07/29 12:17:34 edink Exp $ */
/* Check CWD for php.ini */
#define INI_CHECK_CWD
@@ -312,7 +312,12 @@
}
/* Search php.ini file in search path */
if (!fh.handle.fp) {
- fh.handle.fp = php_fopen_with_path("php.ini", "r", php_ini_search_path,
&php_ini_opened_path TSRMLS_CC);
+ char *ini_fname=emalloc(10+strlen(sapi_module.name));
+ sprintf(ini_fname, "php-%s.ini", sapi_module.name);
+ if (!(fh.handle.fp = php_fopen_with_path(ini_fname, "r", php_ini_search_path,
&php_ini_opened_path TSRMLS_CC))) {
+ fh.handle.fp = php_fopen_with_path("php.ini", "r", php_ini_search_path,
&php_ini_opened_path TSRMLS_CC);
+ }
+ efree(ini_fname);
fh.filename = php_ini_opened_path;
}
if (free_ini_search_path) {