summaryrefslogtreecommitdiff
path: root/sapi/cli
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2004-02-04 22:49:28 +0000
committerIlia Alshanetsky <iliaa@php.net>2004-02-04 22:49:28 +0000
commitffd3b1dd0a021ea6ddcfbd7230263df216266003 (patch)
tree348e071031c4ad609f188238d4e64a72dd9c87bd /sapi/cli
parenta44838e8a3072114ba4e23486efcd219ae0c0f9c (diff)
downloadphp-git-ffd3b1dd0a021ea6ddcfbd7230263df216266003.tar.gz
Parse command line ini directives passed using -d before -i, to ensure
correct settings output.
Diffstat (limited to 'sapi/cli')
-rw-r--r--sapi/cli/php_cli.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c
index 9ee2dacf83..9d9870a020 100644
--- a/sapi/cli/php_cli.c
+++ b/sapi/cli/php_cli.c
@@ -641,10 +641,21 @@ int main(int argc, char *argv[])
exit_status=1;
goto out_err;
}
-
+
+ /* here is the place for hard coded defaults which cannot be overwritten in the ini file */
+ INI_HARDCODED("register_argc_argv", "1");
+ INI_HARDCODED("html_errors", "0");
+ INI_HARDCODED("implicit_flush", "1");
+ INI_HARDCODED("output_buffering", "0");
+ INI_HARDCODED("max_execution_time", "0");
+
while ((c = php_getopt(argc, argv, OPTIONS, &optarg, &optind, 0)) != -1) {
switch (c) {
+ case 'd': /* define ini entries on command line */
+ define_command_line_ini_entry(optarg);
+ break;
+
case 'h': /* help & quit */
case '?':
php_output_startup();
@@ -696,12 +707,6 @@ int main(int argc, char *argv[])
/* Set some CLI defaults */
SG(options) |= SAPI_OPTION_NO_CHDIR;
- /* here is the place for hard coded defaults which cannot be overwritten in the ini file */
- INI_HARDCODED("register_argc_argv", "1");
- INI_HARDCODED("html_errors", "0");
- INI_HARDCODED("implicit_flush", "1");
- INI_HARDCODED("output_buffering", "0");
- INI_HARDCODED("max_execution_time", "0");
optind = orig_optind;
optarg = orig_optarg;
@@ -717,9 +722,6 @@ int main(int argc, char *argv[])
case 'C': /* don't chdir to the script directory */
/* This is default so NOP */
break;
- case 'd': /* define ini entries on command line */
- define_command_line_ini_entry(optarg);
- break;
case 'e': /* enable extended info output */
CG(extended_info) = 1;