@@ -158,7 +158,7 @@ const opt_struct OPTIONS[] = {
158
158
{13 , 1 , "rzendextension" },
159
159
{14 , 1 , "ri" },
160
160
{14 , 1 , "rextinfo" },
161
- {15 , 0 , "ini" },
161
+ {15 , 2 , "ini" },
162
162
/* Internal testing option -- may be changed or removed without notice,
163
163
* including in patch releases. */
164
164
{16 , 1 , "repeat" },
@@ -500,6 +500,7 @@ static void php_cli_usage(char *argv0)
500
500
" starts with - or script is read from stdin\n"
501
501
"\n"
502
502
" --ini Show configuration file names\n"
503
+ " --ini=diff Show INI entries that differ from the built-in default\n"
503
504
"\n"
504
505
" --rf <name> Show information about function <name>.\n"
505
506
" --rc <name> Show information about class <name>.\n"
@@ -822,7 +823,15 @@ static int do_cli(int argc, char **argv) /* {{{ */
822
823
reflection_what = php_optarg ;
823
824
break ;
824
825
case 15 :
825
- context .mode = PHP_CLI_MODE_SHOW_INI_CONFIG ;
826
+ if (php_optarg ) {
827
+ if (strcmp (php_optarg , "diff" ) == 0 ) {
828
+ context .mode = PHP_CLI_MODE_SHOW_INI_DIFF ;
829
+ } else {
830
+ param_error = "Unknown argument for --ini\n" ;
831
+ }
832
+ } else {
833
+ context .mode = PHP_CLI_MODE_SHOW_INI_CONFIG ;
834
+ }
826
835
break ;
827
836
case 16 :
828
837
num_repeats = atoi (php_optarg );
@@ -1101,7 +1110,10 @@ static int do_cli(int argc, char **argv) /* {{{ */
1101
1110
zend_printf ("Loaded Configuration File: %s\n" , php_ini_opened_path ? php_ini_opened_path : "(none)" );
1102
1111
zend_printf ("Scan for additional .ini files in: %s\n" , php_ini_scanned_path ? php_ini_scanned_path : "(none)" );
1103
1112
zend_printf ("Additional .ini files parsed: %s\n" , php_ini_scanned_files ? php_ini_scanned_files : "(none)" );
1104
- zend_printf ("\n" );
1113
+ break ;
1114
+ }
1115
+ case PHP_CLI_MODE_SHOW_INI_DIFF :
1116
+ {
1105
1117
zend_printf ("Non-default INI settings:\n" );
1106
1118
zend_ini_entry * ini_entry ;
1107
1119
HashTable * sorted = zend_array_dup (EG (ini_directives ));
0 commit comments