From 85a511d2c1b7d7489630d7e2d1112bddd4e20203 Mon Sep 17 00:00:00 2001 From: Joe Watkins Date: Tue, 1 Sep 2015 09:34:54 +0100 Subject: fix zend signal and tsrm compat --- sapi/cli/php_cli.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sapi/cli/php_cli.c') diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index 3b2bed8538..94d5b84f67 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -1220,6 +1220,10 @@ int main(int argc, char *argv[]) ZEND_TSRMLS_CACHE_UPDATE(); #endif +#ifdef ZEND_SIGNALS + zend_signal_startup(); +#endif + #ifdef PHP_WIN32 _fmode = _O_BINARY; /*sets default for file streams to binary */ setmode(_fileno(stdin), O_BINARY); /* make the stdio mode be binary */ -- cgit v1.2.1 From ba6d193b4cc4992104a7543509dc4db01832ee97 Mon Sep 17 00:00:00 2001 From: Bob Weinand Date: Wed, 30 Sep 2015 12:39:09 +0200 Subject: Add NTS/ZTS information to php -v --- sapi/cli/php_cli.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'sapi/cli/php_cli.c') diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index 94d5b84f67..b4288b87a2 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -682,17 +682,20 @@ static int do_cli(int argc, char **argv) /* {{{ */ goto out; case 'v': /* show php version & quit */ - php_printf("PHP %s (%s) (built: %s %s) %s\nCopyright (c) 1997-2015 The PHP Group\n%s", + php_printf("PHP %s (%s) (built: %s %s) ( %s)\nCopyright (c) 1997-2015 The PHP Group\n%s", PHP_VERSION, cli_sapi_module.name, __DATE__, __TIME__, -#if ZEND_DEBUG && defined(HAVE_GCOV) - "(DEBUG GCOV)", -#elif ZEND_DEBUG - "(DEBUG)", -#elif defined(HAVE_GCOV) - "(GCOV)", +#if ZTS + "ZTS " #else - "", + "NTS " #endif +#if ZEND_DEBUG + "DEBUG " +#endif +#ifdef HAVE_GCOV + "GCOV " +#endif + , get_zend_version() ); sapi_deactivate(); -- cgit v1.2.1 From 49493a2dcfb2cd1758b69b13d9006ead3be0e066 Mon Sep 17 00:00:00 2001 From: Lior Kaplan Date: Fri, 1 Jan 2016 19:19:27 +0200 Subject: Happy new year (Update copyright to 2016) --- sapi/cli/php_cli.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sapi/cli/php_cli.c') diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index db5ddb2567..40a41e544d 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2015 The PHP Group | + | Copyright (c) 1997-2016 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 | @@ -693,7 +693,7 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */ goto out; case 'v': /* show php version & quit */ - php_printf("PHP %s (%s) (built: %s %s) %s\nCopyright (c) 1997-2015 The PHP Group\n%s", + php_printf("PHP %s (%s) (built: %s %s) %s\nCopyright (c) 1997-2016 The PHP Group\n%s", PHP_VERSION, cli_sapi_module.name, __DATE__, __TIME__, #if ZEND_DEBUG && defined(HAVE_GCOV) "(DEBUG GCOV)", -- cgit v1.2.1 From 3ac63df9bc27226c25cca5c87804896d33a7ab4f Mon Sep 17 00:00:00 2001 From: Joe Watkins Date: Wed, 10 Feb 2016 12:57:48 +0000 Subject: be more precise about the meaning of -n --- sapi/cli/php_cli.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sapi/cli/php_cli.c') diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index a387059e27..907f629c01 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -517,7 +517,7 @@ static void php_cli_usage(char *argv0) " -a Run interactively\n" #endif " -c | Look for php.ini file in this directory\n" - " -n No php.ini file will be used\n" + " -n No configuration (ini) files will be used\n" " -d foo[=bar] Define INI entry foo with value 'bar'\n" " -e Generate extended information for debugger/profiler\n" " -f Parse and execute .\n" -- cgit v1.2.1 From 1ac152938cfe40e98b7b3c8cf403abb113266cfa Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Thu, 3 Mar 2016 16:46:04 +0100 Subject: Move semicolon into TSRMLS_CACHE_EXTERN/DEFINE Also re bug #71575. --- sapi/cli/php_cli.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sapi/cli/php_cli.c') diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index 907f629c01..92f1f64bf4 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -103,7 +103,7 @@ PHPAPI extern char *php_ini_scanned_path; PHPAPI extern char *php_ini_scanned_files; #if defined(PHP_WIN32) && defined(ZTS) -ZEND_TSRMLS_CACHE_DEFINE(); +ZEND_TSRMLS_CACHE_DEFINE() #endif #ifndef O_BINARY -- cgit v1.2.1 From 68ebfc87ad4f3842cd680c32ab307344c8659ce3 Mon Sep 17 00:00:00 2001 From: Sean DuBois Date: Sat, 12 Mar 2016 21:15:54 -0600 Subject: Fix bug #71624, PHP_MODE_PROCESS_STDIN (CLI SAPI called with '-R') did not properly set $argi and $argn --- sapi/cli/php_cli.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'sapi/cli/php_cli.c') diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index 92f1f64bf4..5d789d2626 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -1018,16 +1018,15 @@ static int do_cli(int argc, char **argv) /* {{{ */ if (exec_begin && zend_eval_string_ex(exec_begin, NULL, "Command line begin code", 1) == FAILURE) { exit_status=254; } - ZVAL_LONG(&argi, index); - zend_hash_str_update(&EG(symbol_table), "argi", sizeof("argi")-1, &argi); while (exit_status == SUCCESS && (input=php_stream_gets(s_in_process, NULL, 0)) != NULL) { len = strlen(input); while (len > 0 && len-- && (input[len]=='\n' || input[len]=='\r')) { input[len] = '\0'; } - ZVAL_STRINGL(&argn, input, len); + ZVAL_STRINGL(&argn, input, len + 1); zend_hash_str_update(&EG(symbol_table), "argn", sizeof("argn")-1, &argn); - Z_LVAL(argi) = ++index; + ZVAL_LONG(&argi, ++index); + zend_hash_str_update(&EG(symbol_table), "argi", sizeof("argi")-1, &argi); if (exec_run) { if (zend_eval_string_ex(exec_run, NULL, "Command line run code", 1) == FAILURE) { exit_status=254; -- cgit v1.2.1 From fa6ce55675c75140339393a0dec7cf5763b950db Mon Sep 17 00:00:00 2001 From: Matt Ficken Date: Mon, 21 Mar 2016 21:09:32 -0700 Subject: bug #71478 implementing feature request --- sapi/cli/php_cli.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'sapi/cli/php_cli.c') diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index 5d789d2626..6683f21393 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -689,6 +689,14 @@ static int do_cli(int argc, char **argv) /* {{{ */ #else "NTS " #endif +#ifdef COMPILER + COMPILER + " " +#endif +#ifdef ARCHITECTURE + ARCHITECTURE + " " +#endif #if ZEND_DEBUG "DEBUG " #endif -- cgit v1.2.1 From dbae1653daba7524f10642155c8c46a907970151 Mon Sep 17 00:00:00 2001 From: Joe Watkins Date: Fri, 29 Apr 2016 10:19:55 +0100 Subject: fix size_t signed comparison --- sapi/cli/php_cli.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sapi/cli/php_cli.c') diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index 5d789d2626..978c8b332e 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -304,7 +304,7 @@ static size_t sapi_cli_ub_write(const char *str, size_t str_length) /* {{{ */ if (cli_shell_callbacks.cli_shell_ub_write) { size_t ub_wrote; ub_wrote = cli_shell_callbacks.cli_shell_ub_write(str, str_length); - if (ub_wrote > -1) { + if (ub_wrote != (size_t) -1) { return ub_wrote; } } -- cgit v1.2.1