@@ -158,7 +158,7 @@ const opt_struct OPTIONS[] = {
158158	{13 ,  1 , "rzendextension" },
159159	{14 ,  1 , "ri" },
160160	{14 ,  1 , "rextinfo" },
161- 	{15 ,  0 , "ini" },
161+ 	{15 ,  2 , "ini" },
162162	/* Internal testing option -- may be changed or removed without notice, 
163163	 * including in patch releases. */ 
164164	{16 ,  1 , "repeat" },
@@ -500,6 +500,7 @@ static void php_cli_usage(char *argv0)
500500				"                   starts with - or script is read from stdin\n" 
501501				"\n" 
502502				"  --ini            Show configuration file names\n" 
503+ 				"  --ini=diff       Show INI entries that differ from the built-in default\n" 
503504				"\n" 
504505				"  --rf <name>      Show information about function <name>.\n" 
505506				"  --rc <name>      Show information about class <name>.\n" 
@@ -822,7 +823,15 @@ static int do_cli(int argc, char **argv) /* {{{ */
822823				reflection_what  =  php_optarg ;
823824				break ;
824825			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+ 				}
826835				break ;
827836			case  16 :
828837				num_repeats  =  atoi (php_optarg );
@@ -1101,7 +1110,10 @@ static int do_cli(int argc, char **argv) /* {{{ */
11011110				zend_printf ("Loaded Configuration File:         %s\n" , php_ini_opened_path  ? php_ini_opened_path  : "(none)" );
11021111				zend_printf ("Scan for additional .ini files in: %s\n" , php_ini_scanned_path   ? php_ini_scanned_path  : "(none)" );
11031112				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+ 			{
11051117				zend_printf ("Non-default INI settings:\n" );
11061118				zend_ini_entry  * ini_entry ;
11071119				HashTable  * sorted  =  zend_array_dup (EG (ini_directives ));
0 commit comments