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