Beispiel #1
0
 /**
  * Performs all periodical actions.
  *
  * @return boolean True if all periodical actions are done and false
  * otherwise.
  */
 public function run()
 {
     try {
         set_time_limit(0);
         // Update time of last cron run
         Settings::set('_last_cron_run', time());
         // Remove stale cached items
         $this->cache->purge();
         // Run cron jobs of the core
         calculate_thread_statistics();
         calculate_operator_statistics();
         calculate_page_statistics();
         // Trigger cron event
         $dispatcher = EventDispatcher::getInstance();
         $dispatcher->triggerEvent(Events::CRON_RUN);
         if (Settings::get('autocheckupdates') == '1') {
             // Run the update checker
             $update_checker = $this->getUpdateChecker();
             if (!$update_checker->run()) {
                 $this->errors = array_merge($this->errors, $update_checker->getErrors());
                 return false;
             }
         }
     } catch (\Exception $e) {
         $this->log[] = $e->getMessage();
         return false;
     }
     return true;
 }
Beispiel #2
0
 /**
  * Performs all periodical actions.
  *
  * @return boolean True if all periodical actions are done and false
  * otherwise.
  */
 public function run()
 {
     try {
         set_time_limit(0);
         // Remove stale cached items
         $this->cache->purge();
         // Run cron jobs of the core
         calculate_thread_statistics();
         calculate_operator_statistics();
         calculate_page_statistics();
         // Trigger cron event
         $dispatcher = EventDispatcher::getInstance();
         $dispatcher->triggerEvent(Events::CRON_RUN);
         // Update time of last cron run
         Settings::set('_last_cron_run', time());
     } catch (\Exception $e) {
         $this->log[] = $e->getMessage();
         return false;
     }
     return true;
 }
Beispiel #3
0
 /**
  * Garbage collection - remove all expired and deleted data
  *
  * @return void
  */
 public function garbageCollect()
 {
     return $this->pool->purge();
 }