cvs: php4 /main php_ini.c /sapi/cgi cgi_main.c /sapi/cli php_cli.c

From: Date: Fri, 12 Apr 2002 00:20:29 +0000
Subject: cvs: php4 /main php_ini.c /sapi/cgi cgi_main.c /sapi/cli php_cli.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-11070@lists.php.net to get a copy of this message
yohgaki Thu Apr 11 20:20:29 2002 EDT Modified files: /php4/main php_ini.c /php4/sapi/cli php_cli.c /php4/sapi/cgi cgi_main.c Log: 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) Index: php4/main/php_ini.c diff -u php4/main/php_ini.c:1.80 php4/main/php_ini.c:1.81 --- php4/main/php_ini.c:1.80 Mon Mar 4 19:21:28 2002 +++ php4/main/php_ini.c Thu Apr 11 20:20:28 2002 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_ini.c,v 1.80 2002/03/05 00:21:28 fmk Exp $ */ +/* $Id: php_ini.c,v 1.81 2002/04/12 00:20:28 yohgaki Exp $ */ #include "php.h" #ifndef PHP_WIN32 @@ -262,8 +262,15 @@ PG(safe_mode) = 0; PG(open_basedir) = NULL; - - fh.handle.fp = php_fopen_with_path("php.ini", "r", php_ini_search_path, &php_ini_opened_path TSRMLS_CC); + + 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); } Index: php4/sapi/cli/php_cli.c diff -u php4/sapi/cli/php_cli.c:1.18 php4/sapi/cli/php_cli.c:1.19 --- php4/sapi/cli/php_cli.c:1.18 Wed Mar 27 17:49:21 2002 +++ php4/sapi/cli/php_cli.c Thu Apr 11 20:20:28 2002 @@ -240,27 +240,27 @@ } else { prog = "php"; } - + php_printf( "Usage: %s [options] [-f] <file> [args...]\n" " %s [options] -r <code> [args...]\n" " %s [options] [-- args...]\n" - " -s Display colour syntax highlighted source.\n" - " -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" - " -a Run interactively\n" - " -d foo[=bar] Define INI entry foo with value 'bar'\n" - " -e Generate extended information for debugger/profiler\n" - " -z <file> Load Zend extension <file>.\n" - " -l Syntax check only (lint)\n" - " -m Show compiled in modules\n" - " -i PHP information\n" - " -r <code> Run PHP <code> without using script tags <?..?>\n" - " -h This help\n" + " -s Display colour syntax highlighted source.\n" + " -w Display source with stripped comments and whitespace.\n" + " -f <file> Parse <file>.\n" + " -v Version number\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" + " -z <file> Load Zend extension <file>.\n" + " -l Syntax check only (lint)\n" + " -m Show compiled in modules\n" + " -i PHP information\n" + " -r <code> Run PHP <code> without using script tags <?..?>\n" + " -h This help\n" "\n" - " args... Arguments passed to script. Use -- args when first argument \n" - " starts with - or script is read from stdin\n" + " args... Arguments passed to script. Use -- args when first argument \n" + " starts with - or script is read from stdin\n" , prog, prog, prog); } /* }}} */ Index: php4/sapi/cgi/cgi_main.c diff -u php4/sapi/cgi/cgi_main.c:1.157 php4/sapi/cgi/cgi_main.c:1.158 --- php4/sapi/cgi/cgi_main.c:1.157 Tue Apr 2 11:45:10 2002 +++ php4/sapi/cgi/cgi_main.c Thu Apr 11 20:20:29 2002 @@ -327,21 +327,21 @@ } php_printf("Usage: %s [-q] [-h] [-s [-v] [-i] [-f <file>] | {<file> [args...]}\n" - " -q Quiet-mode. Suppress HTTP Header output.\n" - " -s Display colour syntax highlighted source.\n" - " -w Display source with stripped comments and whitespace.\n" - " -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" - " -a Run interactively\n" - " -d foo[=bar] Define INI entry foo with value 'bar'\n" - " -e Generate extended information for debugger/profiler\n" - " -z <file> Load Zend extension <file>.\n" - " -l Syntax check only (lint)\n" - " -m Show compiled in modules\n" - " -i PHP information\n" - " -h This help\n", prog); + " -q Quiet-mode. Suppress HTTP Header output.\n" + " -s Display colour syntax highlighted source.\n" + " -w Display source with stripped comments and whitespace.\n" + " -f <file> Parse <file>. Implies `-q'\n" + " -v Version number\n" + " -C Do not chdir to the script's 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" + " -z <file> Load Zend extension <file>.\n" + " -l Syntax check only (lint)\n" + " -m Show compiled in modules\n" + " -i PHP information\n" + " -h This help\n", prog); } /* }}} */

« previous php.cvs (#11070) next »