mirror of
https://github.com/moodle/moodle.git
synced 2025-04-22 17:02:03 +02:00
MDL-68714 cron: Check value of CLI_SCRIPT not existence
This commit is contained in:
parent
b5878eaec9
commit
834aba2309
@ -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 (defined('CLI_SCRIPT') && isset($_SERVER['argv'])) {
|
||||
if (CLI_SCRIPT && isset($_SERVER['argv'])) {
|
||||
$command = join(' ', $_SERVER['argv']);
|
||||
@cli_set_process_title("php $command ($suffix)");
|
||||
}
|
||||
|
@ -383,7 +383,7 @@ function cron_run_inner_adhoc_task(\core\task\adhoc_task $task) {
|
||||
*/
|
||||
function cron_set_process_title(string $title) {
|
||||
global $CFG;
|
||||
if (defined('CLI_SCRIPT')) {
|
||||
if (CLI_SCRIPT) {
|
||||
require_once($CFG->libdir . '/clilib.php');
|
||||
$datetime = userdate(time(), '%b %d, %H:%M:%S');
|
||||
cli_set_process_title_suffix("$datetime $title");
|
||||
|
Loading…
x
Reference in New Issue
Block a user