mirror of
https://github.com/php/php-src.git
synced 2024-11-26 11:23:47 +08:00
CGI/CLI take file and dir for -c option by this.
@ Both 'file' and 'path to php.ini' is allowed for "-c" cli/cgi option. (Yasuo)
This commit is contained in:
parent
fffb1a5d21
commit
439b56842f
@ -263,6 +263,13 @@ int php_init_config(char *php_ini_path_override)
|
||||
PG(safe_mode) = 0;
|
||||
PG(open_basedir) = NULL;
|
||||
|
||||
fh.handle.fp = NULL;
|
||||
/* Check if php_ini_path_override is a file */
|
||||
if (php_ini_path_override && !php_ini_path_override[0]) {
|
||||
fh.handle.fp = VCWD_FOPEN(php_ini_path_override, "r");
|
||||
}
|
||||
/* 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);
|
||||
if (free_ini_search_path) {
|
||||
efree(php_ini_search_path);
|
||||
|
@ -333,7 +333,7 @@ static void php_cgi_usage(char *argv0)
|
||||
" -f <file> Parse <file>. Implies `-q'\n"
|
||||
" -v Version number\n"
|
||||
" -C Do not chdir to the script's directory\n"
|
||||
" -c <path> Look for php.ini file in this directory\n"
|
||||
" -c <path>|<file> Look for php.ini file in this directory\n"
|
||||
" -a Run interactively\n"
|
||||
" -d foo[=bar] Define INI entry foo with value 'bar'\n"
|
||||
" -e Generate extended information for debugger/profiler\n"
|
||||
|
@ -248,7 +248,7 @@ static void php_cli_usage(char *argv0)
|
||||
" -w Display source with stripped comments and whitespace.\n"
|
||||
" -f <file> Parse <file>.\n"
|
||||
" -v Version number\n"
|
||||
" -c <path> Look for php.ini file in this directory\n"
|
||||
" -c <path>|<file> Look for php.ini file in this directory\n"
|
||||
" -a Run interactively\n"
|
||||
" -d foo[=bar] Define INI entry foo with value 'bar'\n"
|
||||
" -e Generate extended information for debugger/profiler\n"
|
||||
|
Loading…
Reference in New Issue
Block a user