summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJérôme Loyet <fat@php.net>2010-03-29 10:45:28 +0000
committerJérôme Loyet <fat@php.net>2010-03-29 10:45:28 +0000
commite3c3c42c7b1f12a805ebe13c021bce1c6eae339b (patch)
tree2afeacf63fdd97a62f852135f7a7574c388cc790
parent7baa1b0a6e5ba1c96fd368c84fec272c161c250e (diff)
downloadphp-git-e3c3c42c7b1f12a805ebe13c021bce1c6eae339b.tar.gz
Add fpm.conf directive to global php.ini configuration file. It's used to specify where to find the FPM configuration file. By default it's not set and the -y runtime switch has priority. If neither fpm.conf or -y is used, FPM will try the default path PHP_SYSCONFDIR/php-fpm.conf.
TODO: add "; fpm.conf = PHP_SYSCONFDIR/php-fpm.conf" to php.ini with additional documentation. It has to be done when FPM will be included into the trunk.
-rw-r--r--sapi/fpm/fpm/fpm_main.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c
index 1d593c7b08..3af72f9086 100644
--- a/sapi/fpm/fpm/fpm_main.c
+++ b/sapi/fpm/fpm/fpm_main.c
@@ -173,6 +173,7 @@ typedef struct _php_cgi_globals_struct {
#endif
HashTable user_config_cache;
char *error_header;
+ char *fpm_conf;
struct event_base *event_base;
} php_cgi_globals_struct;
@@ -1407,6 +1408,7 @@ PHP_INI_BEGIN()
STD_PHP_INI_ENTRY("fastcgi.impersonate", "0", PHP_INI_SYSTEM, OnUpdateBool, impersonate, php_cgi_globals_struct, php_cgi_globals)
#endif
STD_PHP_INI_ENTRY("fastcgi.error_header", NULL, PHP_INI_SYSTEM, OnUpdateString, error_header, php_cgi_globals_struct, php_cgi_globals)
+ STD_PHP_INI_ENTRY("fpm.conf", NULL, PHP_INI_SYSTEM, OnUpdateString, fpm_conf, php_cgi_globals_struct, php_cgi_globals)
PHP_INI_END()
/* {{{ php_cgi_globals_ctor
@@ -1426,6 +1428,7 @@ static void php_cgi_globals_ctor(php_cgi_globals_struct *php_cgi_globals TSRMLS_
#endif
zend_hash_init(&php_cgi_globals->user_config_cache, 0, NULL, (dtor_func_t) user_config_cache_entry_dtor, 1);
php_cgi_globals->error_header = NULL;
+ php_cgi_globals->fpm_conf = NULL;
}
/* }}} */
@@ -1747,7 +1750,7 @@ consult the installation file that came with this distribution, or visit \n\
}
}
- if (0 > fpm_init(argc, argv, fpm_config, &CGIG(event_base))) {
+ if (0 > fpm_init(argc, argv, fpm_config ? fpm_config : CGIG(fpm_conf), &CGIG(event_base))) {
return FAILURE;
}