Пример #1
0
 public function actionParseCrontab()
 {
     if (isset($_POST['crontab'])) {
         $result = TaskManager::parseCrontab($_POST['crontab'], new Task());
         echo json_encode($result);
     }
 }
Пример #2
0
 public function testParseCrontab()
 {
     $task = TaskMock::createNew();
     $cron = '
     #comment
     * * * * * cd path/; /usr/bin/php index.php controller method args 2>&1 > /dev/null
     * * * * -1 cd path/; /usr/bin/php index.php controller method args 2>&1 > /dev/null
     * * * * * cd path/; wrong expression';
     TaskManager::parseCrontab($cron, $task);
 }