예제 #1
0
파일: Tasks.php 프로젝트: MartkCz/Cronner
 public function getTab()
 {
     ob_start();
     $count = $this->cronner->countTasks();
     require __DIR__ . '/templates/tab.phtml';
     return ob_get_clean();
 }
예제 #2
0
 public function actionDefault()
 {
     $this->cronner->onTaskBegin[] = function (Cronner $cronner, Task $task) {
         echo '<h3>' . $task->getName() . '</h3>';
         Debugger::timer($task->getName());
     };
     $this->cronner->onTaskFinished[] = function (Cronner $cronner, Task $task) {
         echo '<p>Total time: ' . Debugger::timer($task->getName()) . ' s</p>';
     };
     $this->cronner->run();
     $this->terminate();
 }