#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>
} 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
*/