summaryrefslogtreecommitdiff
path: root/sapi
diff options
context:
space:
mode:
authorAndrea Faulds <ajf@ajf.me>2015-05-21 18:08:01 +0100
committerJoe Watkins <krakjoe@php.net>2016-11-12 17:26:20 +0000
commita103aa2dbd9fe4261e7ebbafb00ff5283c7fb5e5 (patch)
tree543e7edac52286a858eca0ab874765e387ef17bd /sapi
parent28ebf8df668014df3d74837f2fdb7a24a895bb9c (diff)
downloadphp-git-a103aa2dbd9fe4261e7ebbafb00ff5283c7fb5e5.tar.gz
Show "php://stdin" instead of "-" in error messages
Diffstat (limited to 'sapi')
-rw-r--r--sapi/cgi/cgi_main.c2
-rw-r--r--sapi/cgi/tests/007.phpt2
-rw-r--r--sapi/cli/php_cli.c4
-rw-r--r--sapi/cli/tests/015.phpt2
4 files changed, 5 insertions, 5 deletions
diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c
index 0b6deb10e8..bf33dc109b 100644
--- a/sapi/cgi/cgi_main.c
+++ b/sapi/cgi/cgi_main.c
@@ -2431,7 +2431,7 @@ consult the installation file that came with this distribution, or visit \n\
file_handle.filename = SG(request_info).path_translated;
file_handle.handle.fp = NULL;
} else {
- file_handle.filename = "-";
+ file_handle.filename = "php://stdin";
file_handle.type = ZEND_HANDLE_FP;
file_handle.handle.fp = stdin;
}
diff --git a/sapi/cgi/tests/007.phpt b/sapi/cgi/tests/007.phpt
index f2c9c0226c..ed83db0cf3 100644
--- a/sapi/cgi/tests/007.phpt
+++ b/sapi/cgi/tests/007.phpt
@@ -17,6 +17,6 @@ var_dump(`"$php" -n -s -w -l`);
--EXPECTF--
string(25) "No input file specified.
"
-string(31) "No syntax errors detected in -
+string(41) "No syntax errors detected in php://stdin
"
===DONE===
diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c
index 56ab3fec6d..28a5a7c108 100644
--- a/sapi/cli/php_cli.c
+++ b/sapi/cli/php_cli.c
@@ -945,7 +945,7 @@ static int do_cli(int argc, char **argv) /* {{{ */
/* here but this would make things only more complicated. And it */
/* is consitent with the way -R works where the stdin file handle*/
/* is also accessible. */
- file_handle.filename = "-";
+ file_handle.filename = "php://stdin";
file_handle.handle.fp = stdin;
}
file_handle.type = ZEND_HANDLE_FP;
@@ -984,7 +984,7 @@ static int do_cli(int argc, char **argv) /* {{{ */
PG(during_request_startup) = 0;
switch (behavior) {
case PHP_MODE_STANDARD:
- if (strcmp(file_handle.filename, "-")) {
+ if (strcmp(file_handle.filename, "php://stdin")) {
cli_register_file_handles();
}
diff --git a/sapi/cli/tests/015.phpt b/sapi/cli/tests/015.phpt
index ab5918b4d2..da2b64617d 100644
--- a/sapi/cli/tests/015.phpt
+++ b/sapi/cli/tests/015.phpt
@@ -24,7 +24,7 @@ echo "Done\n";
PHP %d.%d.%d%s(cli) (built: %s)%s
Array
(
- [0] => -
+ [0] => php://stdin
[1] => foo
[2] => bar
[3] => baz