diff options
author | Stanislav Malyshev <stas@php.net> | 2003-10-19 10:39:27 +0000 |
---|---|---|
committer | Stanislav Malyshev <stas@php.net> | 2003-10-19 10:39:27 +0000 |
commit | 06aae4bd9c806774e2447071f4e5d845d4a90ad5 (patch) | |
tree | 2f3151fb236b18bf785da3beb7d99d5e375579f6 /main/php_ini.c | |
parent | 405361f7ea5c5d95d3dc396b65a49a994c74726c (diff) | |
download | php-git-06aae4bd9c806774e2447071f4e5d845d4a90ad5.tar.gz |
Enable setting php.ini path via the registry
Diffstat (limited to 'main/php_ini.c')
-rw-r--r-- | main/php_ini.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/main/php_ini.c b/main/php_ini.c index b6e8b87dd2..2a413fbaab 100644 --- a/main/php_ini.c +++ b/main/php_ini.c @@ -31,6 +31,9 @@ #include "SAPI.h" #include "php_main.h" #include "php_scandir.h" +#ifdef PHP_WIN32 +#include "win32/php_registry.h" +#endif #if HAVE_SCANDIR && HAVE_ALPHASORT && HAVE_DIRENT_H #include <dirent.h> @@ -297,11 +300,23 @@ int php_init_config() } else { char *default_location; static const char paths_separator[] = { ZEND_PATHS_SEPARATOR, 0 }; + char *reg_location; - php_ini_search_path = (char *) emalloc(MAXPATHLEN * 3 + strlen(env_location) + 3 + 1); + php_ini_search_path = (char *) emalloc(MAXPATHLEN * 4 + strlen(env_location) + 3 + 1); free_ini_search_path = 1; php_ini_search_path[0] = 0; +#ifdef PHP_WIN32 + /* Add registry location */ + reg_location = GetIniPathFromRegistry(); + if(reg_location != NULL) { + if (*php_ini_search_path) { + strcat(php_ini_search_path, paths_separator); + } + strcat(php_ini_search_path, reg_location); + efree(reg_location); + } +#endif /* * Prepare search path */ |