Index: sapi/cli/php_cli.c =================================================================== --- sapi/cli/php_cli.c (revision 312931) +++ sapi/cli/php_cli.c (working copy) @@ -128,7 +128,15 @@ "max_execution_time=0\n" "max_input_time=-1\n\0"; +const char QUIET_INI[] = + "display_errors=0\n" + "error_reporting=0\n\0"; +const char STRICT_INI[] = + "display_errors=1\n" + "error_reporting=-1\n\0"; + + const opt_struct OPTIONS[] = { {'a', 0, "interactive"}, {'B', 1, "process-begin"}, @@ -145,6 +153,7 @@ {'m', 0, "modules"}, {'n', 0, "no-php-ini"}, {'q', 0, "no-header"}, /* for compatibility with CGI (do not generate HTTP headers) */ + {'Q', 0, "quiet"}, {'R', 1, "process-code"}, {'H', 0, "hide-args"}, {'r', 1, "run"}, @@ -153,6 +162,7 @@ {'S', 1, "server"}, {'t', 1, "docroot"}, {'w', 0, "strip"}, + {'W', 0, "strict"}, {'?', 0, "usage"},/* help alias (both '?' and 'usage') */ {'v', 0, "version"}, {'z', 1, "zend-extension"}, @@ -515,6 +525,7 @@ " -i PHP information\n" " -l Syntax check only (lint)\n" " -m Show compiled in modules\n" + " -Q Disable all error reporting levels.\n" " -r Run PHP without using script tags \n" " -B Run PHP before processing input lines\n" " -R Run PHP for every input line\n" @@ -526,6 +537,7 @@ " -s Output HTML syntax highlighted source.\n" " -v Version number\n" " -w Output source with stripped comments and whitespace.\n" + " -W Enable all error reporting levels.\n" " -z Load Zend extension .\n" "\n" " args... Arguments passed to script. Use -- args when first argument\n" @@ -1288,6 +1300,18 @@ } break; } + case 'Q': + ini_entries = realloc(ini_entries, ini_entries_len + sizeof(QUIET_INI)); + memcpy(ini_entries + ini_entries_len, QUIET_INI, sizeof(QUIET_INI)); + ini_entries_len += sizeof(QUIET_INI); + + break; + case 'W': + ini_entries = realloc(ini_entries, ini_entries_len + sizeof(STRICT_INI)); + memcpy(ini_entries + ini_entries_len, STRICT_INI, sizeof(STRICT_INI)); + ini_entries_len += sizeof(STRICT_INI); + + break; #ifndef PHP_CLI_WIN32_NO_CONSOLE case 'S': sapi_module = &cli_server_sapi_module; Index: sapi/cli/tests/024.phpt =================================================================== --- sapi/cli/tests/024.phpt (revision 0) +++ sapi/cli/tests/024.phpt (revision 0) @@ -0,0 +1,20 @@ +--TEST-- +-Q option +--SKIPIF-- + +--FILE-- + +--EXPECT-- +string(1) "0" +string(1) "0" +Done Index: sapi/cli/tests/023.phpt =================================================================== --- sapi/cli/tests/023.phpt (revision 0) +++ sapi/cli/tests/023.phpt (revision 0) @@ -0,0 +1,20 @@ +--TEST-- +-W option +--SKIPIF-- + +--FILE-- + +--EXPECT-- +string(1) "1" +string(2) "-1" +Done