File tree Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -490,8 +490,6 @@ static void php_cli_usage(char *argv0)
490
490
"\n"
491
491
#if (defined (HAVE_LIBREADLINE ) || defined (HAVE_LIBEDIT )) && !defined (COMPILE_DL_READLINE )
492
492
" -a Run as interactive shell\n"
493
- #else
494
- " -a Run interactively\n"
495
493
#endif
496
494
" -c <path>|<file> Look for php.ini file in this directory\n"
497
495
" -n No configuration (ini) files will be used\n"
@@ -694,6 +692,10 @@ static int do_cli(int argc, char **argv) /* {{{ */
694
692
switch (c ) {
695
693
696
694
case 'a' : /* interactive mode */
695
+ if (!cli_shell_callbacks .cli_shell_run ) {
696
+ param_error = "Interactive shell (-a) requires the readline extension.\n" ;
697
+ break ;
698
+ }
697
699
if (!interactive ) {
698
700
if (behavior != PHP_MODE_STANDARD ) {
699
701
param_error = param_mode_conflict ;
@@ -874,13 +876,7 @@ static int do_cli(int argc, char **argv) /* {{{ */
874
876
#endif
875
877
876
878
if (interactive ) {
877
- if (cli_shell_callbacks .cli_shell_run ) {
878
- printf ("Interactive shell\n\n" );
879
- } else {
880
- printf ("Interactive mode enabled\n\n" );
881
- /* Treat as non-interactive apart from the stdin input */
882
- interactive = false;
883
- }
879
+ printf ("Interactive shell\n\n" );
884
880
fflush (stdout );
885
881
}
886
882
Original file line number Diff line number Diff line change 1
1
--TEST--
2
2
using invalid combinations of cmdline options
3
+ --EXTENSIONS--
4
+ readline
3
5
--SKIPIF--
4
6
<?php include "skipif.inc " ; ?>
5
7
--FILE--
Original file line number Diff line number Diff line change 1
1
--TEST--
2
2
more invalid arguments and error messages
3
+ --EXTENSIONS--
4
+ readline
3
5
--SKIPIF--
4
6
<?php include "skipif.inc " ; ?>
5
7
--FILE--
You can’t perform that action at this time.
0 commit comments