diff --git a/lib/Cron/CronHelper.php b/lib/Cron/CronHelper.php index 79ec6a5b49..b72918fb49 100644 --- a/lib/Cron/CronHelper.php +++ b/lib/Cron/CronHelper.php @@ -13,7 +13,7 @@ class CronHelper { static function createDaemon($token) { $daemon = array( - 'status' => Daemon::DAEMON_STATUS_STARTING, + 'status' => Daemon::STATUS_STARTING, 'counter' => 0, 'token' => $token ); diff --git a/lib/Cron/Daemon.php b/lib/Cron/Daemon.php index b6b3e158d0..879c764bc4 100644 --- a/lib/Cron/Daemon.php +++ b/lib/Cron/Daemon.php @@ -12,10 +12,10 @@ class Daemon { public $daemon; public $data; public $refreshed_token; - const DAEMON_STATUS_STOPPED = 'stopped'; - const DAEMON_STATUS_STOPPING = 'stopping'; - const DAEMON_STATUS_STARTED = 'started'; - const DAEMON_STATUS_STARTING = 'starting'; + const STATUS_STOPPED = 'stopped'; + const STATUS_STOPPING = 'stopping'; + const STATUS_STARTED = 'started'; + const STATUS_STARTING = 'starting'; private $timer; function __construct($data) { @@ -59,8 +59,8 @@ class Daemon { } $daemon['counter']++; $this->abortIfStopped($daemon); - if($daemon['status'] === self::DAEMON_STATUS_STARTING) { - $daemon['status'] = self::DAEMON_STATUS_STARTED; + if($daemon['status'] === self::STATUS_STARTING) { + $daemon['status'] = self::STATUS_STARTED; } $daemon['token'] = $this->token; CronHelper::saveDaemon($daemon); @@ -68,9 +68,9 @@ class Daemon { } function abortIfStopped($daemon) { - if($daemon['status'] === self::DAEMON_STATUS_STOPPED) exit; - if($daemon['status'] === self::DAEMON_STATUS_STOPPING) { - $daemon['status'] = self::DAEMON_STATUS_STOPPING; + if($daemon['status'] === self::STATUS_STOPPED) exit; + if($daemon['status'] === self::STATUS_STOPPING) { + $daemon['status'] = self::STATUS_STOPPING; CronHelper::saveDaemon($daemon); exit; } diff --git a/lib/Cron/Supervisor.php b/lib/Cron/Supervisor.php index 4bc41860ac..fc93fd478c 100644 --- a/lib/Cron/Supervisor.php +++ b/lib/Cron/Supervisor.php @@ -23,7 +23,7 @@ class Supervisor { // if the daemon is stopped, return its status and do nothing if(!$this->force_run && isset($daemon['status']) && - $daemon['status'] === Daemon::DAEMON_STATUS_STOPPED + $daemon['status'] === Daemon::STATUS_STOPPED ) { return $this->formatDaemonStatusMessage($daemon['status']); @@ -40,8 +40,8 @@ class Supervisor { elseif($elapsed_time < CronHelper::DAEMON_EXECUTION_TIMEOUT && $this->force_run && in_array($daemon['status'], array( - Daemon::DAEMON_STATUS_STOPPING, - Daemon::DAEMON_STATUS_STARTING + Daemon::STATUS_STOPPING, + Daemon::STATUS_STARTING )) ) { return $this->formatDaemonStatusMessage($daemon['status']);