コード例 #1
0
ファイル: Scheduler.php プロジェクト: FluentDevelopment/piwik
 /**
  * Executes the given task
  *
  * @param Task $task
  * @return string
  */
 private function executeTask($task)
 {
     $this->logger->info("Scheduler: executing task {taskName}...", array('taskName' => $task->getName()));
     $this->isRunningTask = true;
     $timer = new Timer();
     try {
         $callable = array($task->getObjectInstance(), $task->getMethodName());
         call_user_func($callable, $task->getMethodParameter());
         $message = $timer->__toString();
     } catch (Exception $e) {
         $message = 'ERROR: ' . $e->getMessage();
     }
     $this->isRunningTask = false;
     $this->logger->info("Scheduler: finished. {timeElapsed}", array('timeElapsed' => $timer));
     return $message;
 }
コード例 #2
0
ファイル: Scheduler.php プロジェクト: bossrabbit/piwik
 /**
  * Executes the given task
  *
  * @param Task $task
  * @return string
  */
 private function executeTask($task)
 {
     $this->logger->debug('Running task {task}', array('task' => $task->getName()));
     try {
         $timer = new Timer();
         call_user_func(array($task->getObjectInstance(), $task->getMethodName()), $task->getMethodParameter());
         $message = $timer->__toString();
     } catch (Exception $e) {
         $message = 'ERROR: ' . $e->getMessage();
     }
     return $message;
 }