File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -874,11 +874,13 @@ static int do_cli(int argc, char **argv) /* {{{ */
874
874
#endif
875
875
876
876
if (interactive ) {
877
- #if (defined(HAVE_LIBREADLINE ) || defined(HAVE_LIBEDIT )) && !defined(COMPILE_DL_READLINE )
878
- printf ("Interactive shell\n\n" );
879
- #else
880
- printf ("Interactive mode enabled\n\n" );
881
- #endif
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
+ }
882
884
fflush (stdout );
883
885
}
884
886
@@ -963,7 +965,7 @@ static int do_cli(int argc, char **argv) /* {{{ */
963
965
cli_register_file_handles (/* no_close */ PHP_DEBUG || num_repeats > 1 );
964
966
}
965
967
966
- if (interactive && cli_shell_callbacks . cli_shell_run ) {
968
+ if (interactive ) {
967
969
EG (exit_status ) = cli_shell_callbacks .cli_shell_run ();
968
970
} else {
969
971
php_execute_script (& file_handle );
You can’t perform that action at this time.
0 commit comments