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/tests/cli_get_process_title_basic.phpt4
-rw-r--r--sapi/cli/tests/cli_process_title_unix.phpt4
-rw-r--r--sapi/cli/tests/cli_set_process_title_basic.phpt4
4 files changed, 16 insertions, 2 deletions
diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c
index 82051758f3..144a610a56 100644
--- a/sapi/cli/php_cli.c
+++ b/sapi/cli/php_cli.c
@@ -961,6 +961,12 @@ static int do_cli(int argc, char **argv) /* {{{ */
}
request_started = 1;
CG(start_lineno) = lineno;
+
+ zend_register_bool_constant(
+ ZEND_STRL("PHP_CLI_PROCESS_TITLE"),
+ is_ps_title_available() == PS_TITLE_SUCCESS,
+ CONST_CS, 0);
+
*arg_excp = arg_free; /* reconstuct argv */
if (hide_argv) {
diff --git a/sapi/cli/tests/cli_get_process_title_basic.phpt b/sapi/cli/tests/cli_get_process_title_basic.phpt
index 66d1d4f3a7..3709095da0 100644
--- a/sapi/cli/tests/cli_get_process_title_basic.phpt
+++ b/sapi/cli/tests/cli_get_process_title_basic.phpt
@@ -6,7 +6,9 @@ Patrick Allaert patrickallaert@php.net
--SKIPIF--
<?php
if (PHP_SAPI !== "cli")
- die("skip");
+ die("skip cli process title not available in non-cli SAPI");
+if (!PHP_CLI_PROCESS_TITLE)
+ die("skip process title not available (disabled or unsupported)");
?>
--FILE--
<?php
diff --git a/sapi/cli/tests/cli_process_title_unix.phpt b/sapi/cli/tests/cli_process_title_unix.phpt
index 418433d8f2..d6e49a2221 100644
--- a/sapi/cli/tests/cli_process_title_unix.phpt
+++ b/sapi/cli/tests/cli_process_title_unix.phpt
@@ -2,6 +2,10 @@
Check cli_process_title support on Unix
--SKIPIF--
<?php
+if (PHP_SAPI !== "cli")
+ die("skip cli process title not available in non-cli SAPI");
+if (!PHP_CLI_PROCESS_TITLE)
+ die("skip process title not available (disabled or unsupported)");
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN')
die("skip");
?>
diff --git a/sapi/cli/tests/cli_set_process_title_basic.phpt b/sapi/cli/tests/cli_set_process_title_basic.phpt
index 9899f3456b..32b8f85a82 100644
--- a/sapi/cli/tests/cli_set_process_title_basic.phpt
+++ b/sapi/cli/tests/cli_set_process_title_basic.phpt
@@ -6,7 +6,9 @@ Patrick Allaert patrickallaert@php.net
--SKIPIF--
<?php
if (PHP_SAPI !== "cli")
- die("skip");
+ die("skip cli process title not available in non-cli SAPI");
+if (!PHP_CLI_PROCESS_TITLE)
+ die("skip process title not available (disabled or unsupported)");
?>
--FILE--
<?php