mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 21:49:15 +01:00
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:
parent
834aba2309
commit
9eaf7a4c3f
@ -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)");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user