Beispiel #1
0
 protected function actionCheckDeleteCron($params)
 {
     if (!GO::modules()->isInstalled('cron')) {
         echo json\encode(array('success' => true, 'data' => array('enabled' => false, 'reason' => 'noCronModule')));
         return;
     }
     $cronJob = GO\Base\Cron\CronJob::model()->findSingleByAttribute('job', 'GO\\Files\\Cron\\DeleteExpiredLinks');
     if (!$cronJob) {
         echo json_encode(array('success' => true, 'data' => array('enabled' => false, 'reason' => 'noCronJob')));
         return;
     }
     echo json_encode(array('success' => true, 'data' => array('enabled' => $cronJob->active)));
 }
Beispiel #2
0
 public function uninstall()
 {
     parent::uninstall();
     $cron = \GO\Base\Cron\CronJob::model()->findSingleByAttribute('job', 'GO\\Dropbox\\Cron\\Sync');
     if (!$cron) {
         // No cronjob found, so nothing needs to be deleted.
         return true;
     }
     if (!$cron->delete()) {
         // Try to delete the cronjob, if it's not possible then throw an exception.
         throw new \Exception('The Dropbox systemtask could not be deleted automatically. Please try to delete it manually in the "System tasks module."');
     } else {
         return true;
     }
 }
Beispiel #3
0
 private function _findNextCron()
 {
     $currentTime = new \GO\Base\Util\Date\DateTime();
     $findParams = \GO\Base\Db\FindParams::newInstance()->single()->criteria(\GO\Base\Db\FindCriteria::newInstance()->addCondition('nextrun', $currentTime->getTimestamp(), '<')->addCondition('active', true));
     return \GO\Base\Cron\CronJob::model()->find($findParams);
 }