]> git.pld-linux.org Git - packages/php.git/blame - php-sapi-ini-file.patch
install extra sapi config to <sapi>.d dir
[packages/php.git] / php-sapi-ini-file.patch
CommitLineData
8f2c8fef 1To test which is main php.ini:
b002612e
ER
2$ php -r 'var_dump(array(get_cfg_var("cfg_file_path"),php_ini_loaded_file()));'
3
4https://github.com/pld-linux/php/commit/762ec2e
5
8f2c8fef
ER
6diff --git a/main/php_ini.c b/main/php_ini.c
7index d508c13b50..2cf28eb7f5 100644
8--- a/main/php_ini.c
9+++ b/main/php_ini.c
10@@ -410,6 +410,11 @@ static void php_load_zend_extension_cb(void *arg) { }
11 #endif
c0240cb1 12 /* }}} */
13
14+static int php_csort(const struct dirent **a, const struct dirent **b)
15+{
16+ return strcmp((*a)->d_name,(*b)->d_name);
17+}
18+
19 /* {{{ php_init_config
20 */
f4ee12ea 21 int php_init_config(void)
8f2c8fef 22@@ -661,12 +666,14 @@ int php_init_config(void)
c0240cb1 23 zend_llist scanned_ini_list;
24 zend_llist_element *element;
25 int l, total_l = 0;
26+ const char *fmt = "%s:" PHP_CONFIG_FILE_PATH "/%s.d";
2e0e7ed6
AM
27 char *bufpath, *debpath, *endpath;
28 int lenpath;
c0240cb1 29
c0240cb1 30 zend_llist_init(&scanned_ini_list, sizeof(char *), (llist_dtor_func_t) free_estring, 1);
b4025702 31
2e0e7ed6
AM
32- bufpath = estrdup(php_ini_scanned_path);
33+ bufpath = emalloc(strlen(php_ini_scanned_path) + strlen(fmt) + strlen(sapi_module.name));
34+ sprintf(bufpath, fmt, php_ini_scanned_path, sapi_module.name);
35 for (debpath = bufpath ; debpath ; debpath=endpath) {
36 endpath = strchr(debpath, DEFAULT_DIR_SEPARATOR);
37 if (endpath) {
8f2c8fef 38@@ -679,7 +686,7 @@ int php_init_config(void)
2e0e7ed6 39 }
b002612e 40 lenpath = (int)strlen(debpath);
c0240cb1 41
2e0e7ed6
AM
42- if (lenpath > 0 && (ndir = php_scandir(debpath, &namelist, 0, php_alphasort)) > 0) {
43+ if (lenpath > 0 && (ndir = php_scandir(debpath, &namelist, 0, php_csort)) > 0) {
c0240cb1 44
45 for (i = 0; i < ndir; i++) {
2e0e7ed6 46
This page took 0.058508 seconds and 4 git commands to generate.