MDL-68714 clilib: Check set_process_title exists
The web cron script at /admin/cron.php pretends to be a CLI script which means that it is not possible to rely upon the CLI_SCRIPT constant.
This commit is contained in:
+1
-1
@@ -154,7 +154,7 @@ function cli_get_params(array $longoptions, array $shortmapping=null) {
|
||||
* @param string $suffix process suffix
|
||||
*/
|
||||
function cli_set_process_title_suffix(string $suffix) {
|
||||
if (CLI_SCRIPT && isset($_SERVER['argv'])) {
|
||||
if (CLI_SCRIPT && function_exists('cli_set_process_title') && isset($_SERVER['argv'])) {
|
||||
$command = join(' ', $_SERVER['argv']);
|
||||
@cli_set_process_title("php $command ($suffix)");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user