summaryrefslogtreecommitdiff
path: root/sapi/cli
diff options
context:
space:
mode:
Diffstat (limited to 'sapi/cli')
-rw-r--r--sapi/cli/php_cli.c6
-rw-r--r--sapi/cli/php_cli_readline.c4
-rw-r--r--sapi/cli/php_cli_readline.h4
-rw-r--r--sapi/cli/tests/016.phpt34
-rw-r--r--sapi/cli/tests/021.phpt4
-rw-r--r--sapi/cli/tests/022.phpt2
6 files changed, 39 insertions, 15 deletions
diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c
index c80d46490..3fbce7476 100644
--- a/sapi/cli/php_cli.c
+++ b/sapi/cli/php_cli.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2011 The PHP Group |
+ | Copyright (c) 1997-2012 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -20,7 +20,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_cli.c 314468 2011-08-08 07:12:12Z laruence $ */
+/* $Id: php_cli.c 321634 2012-01-01 13:15:04Z felipe $ */
#include "php.h"
#include "php_globals.h"
@@ -826,7 +826,7 @@ int main(int argc, char *argv[])
}
request_started = 1;
- php_printf("PHP %s (%s) (built: %s %s) %s\nCopyright (c) 1997-2011 The PHP Group\n%s",
+ php_printf("PHP %s (%s) (built: %s %s) %s\nCopyright (c) 1997-2012 The PHP Group\n%s",
PHP_VERSION, sapi_module.name, __DATE__, __TIME__,
#if ZEND_DEBUG && defined(HAVE_GCOV)
"(DEBUG GCOV)",
diff --git a/sapi/cli/php_cli_readline.c b/sapi/cli/php_cli_readline.c
index 4b601ee55..888f4b60b 100644
--- a/sapi/cli/php_cli_readline.c
+++ b/sapi/cli/php_cli_readline.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2011 The PHP Group |
+ | Copyright (c) 1997-2012 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_cli_readline.c 306939 2011-01-01 02:19:59Z felipe $ */
+/* $Id: php_cli_readline.c 321634 2012-01-01 13:15:04Z felipe $ */
#include "php.h"
diff --git a/sapi/cli/php_cli_readline.h b/sapi/cli/php_cli_readline.h
index 93d869603..d62bb7d50 100644
--- a/sapi/cli/php_cli_readline.h
+++ b/sapi/cli/php_cli_readline.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2011 The PHP Group |
+ | Copyright (c) 1997-2012 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_cli_readline.h 306939 2011-01-01 02:19:59Z felipe $ */
+/* $Id: php_cli_readline.h 321634 2012-01-01 13:15:04Z felipe $ */
#include "php.h"
diff --git a/sapi/cli/tests/016.phpt b/sapi/cli/tests/016.phpt
index adde106df..9c28d15a3 100644
--- a/sapi/cli/tests/016.phpt
+++ b/sapi/cli/tests/016.phpt
@@ -65,25 +65,37 @@ Snippet no. 1:
--------------
Interactive shell
-php > Hello world
-php >
+php > echo 'Hello world';
+Hello world
+php > exit
+
--------------
Snippet no. 2:
--------------
Interactive shell
-php > php ' php ' multine
+php > echo 'multine
+php ' single
+php ' quote';
+multine
single
quote
-php >
+php > exit
+
--------------
Snippet no. 3:
--------------
Interactive shell
-php > <<< > <<< > <<< > <<< > <<< > Here
+php > echo <<<HEREDOC
+<<< > Here
+<<< > comes
+<<< > the
+<<< > doc
+<<< > HEREDOC;
+Here
comes
the
doc
@@ -94,7 +106,11 @@ Snippet no. 4:
--------------
Interactive shell
-php > php { php { php > Done
+php > if (0) {
+php { echo "I'm not there";
+php { }
+php > echo "Done";
+Done
php >
--------------
@@ -102,7 +118,11 @@ Snippet no. 5:
--------------
Interactive shell
-php > php { php { php > I was called!
+php > function a_function_with_some_name() {
+php { echo "I was called!";
+php { }
+php > a_function_with_some_name();
+I was called!
php >
Done
diff --git a/sapi/cli/tests/021.phpt b/sapi/cli/tests/021.phpt
index a4442b0e0..2ddd68890 100644
--- a/sapi/cli/tests/021.phpt
+++ b/sapi/cli/tests/021.phpt
@@ -6,6 +6,10 @@ include 'skipif.inc';
if (substr(PHP_OS, 0, 3) == 'WIN') {
die ("skip not for Windows");
}
+
+if (strlen("#!".getenv('TEST_PHP_EXECUTABLE')) > 127) {
+ die ("skip shebang is too long, see http://www.in-ulm.de/~mascheck/various/shebang/#results");
+}
?>
--FILE--
<?php
diff --git a/sapi/cli/tests/022.phpt b/sapi/cli/tests/022.phpt
index eabb8bdf8..0110220be 100644
--- a/sapi/cli/tests/022.phpt
+++ b/sapi/cli/tests/022.phpt
@@ -8,7 +8,7 @@ if (substr(PHP_OS, 0, 3) == "WIN") die("skip non windows test");
--FILE--
<?php
$php = getenv("TEST_PHP_EXECUTABLE");
-$socket_file = dirname(__FILE__) . '/' . pathinfo(__FILE__, PATHINFO_FILENAME) . '.sock';
+$socket_file = tempnam(sys_get_temp_dir(), pathinfo(__FILE__, PATHINFO_FILENAME) . '.sock');
$test_file = dirname(__FILE__) . '/' . pathinfo(__FILE__, PATHINFO_FILENAME) . '.inc';
if (file_exists($socket_file)) {
unlink($socket_file);