src/TaskManager.php
private static function createTaskWithCrontabLine($task_class, $matches, $comment)
    {
        $task = $task_class::createNew();
        $task->setTime(trim($matches[2]));
        $arguments = str_replace(' ', ',', trim($matches[5]));
        $command = ucfirst($matches[3]) . '::' . $matches[4] . '(' . $arguments . ')';
        $task->setCommand($command);
        if (!empty($comment)) {
            $task->setComment($comment);
        }
        //$output = $matches[7];
        $status = empty($matches[1]) ? TaskInterface::TASK_STATUS_ACTIVE : TaskInterface::TASK_STATUS_INACTIVE;
        $task->setStatus($status);
        $task->setTs(date('Y-m-d H:i:s'));
        $task->taskSave();
        return $task;
    }
private static function createTaskWithCrontabLine($task_class, $matches, $comment)
    {
        $task = $task_class::createNew();
        $task->setTime(trim($matches[2]));
        $arguments = str_replace(' ', ',', trim($matches[5]));
        $command = ucfirst($matches[3]) . '::' . $matches[4] . '(' . $arguments . ')';
        $task->setCommand($command);
        if (!empty($comment)) {
            $task->setComment($comment);
        }
        //$output = $matches[7];
        $status = empty($matches[1]) ? TaskInterface::TASK_STATUS_ACTIVE : TaskInterface::TASK_STATUS_INACTIVE;
        $task->setStatus($status);
        $task->setTs(date('Y-m-d H:i:s'));
        $task->taskSave();
        return $task;
    }
private static function createTaskWithCrontabLine ( $ task_class , $ matches , $ comment ) { $ task = $ task_class :: createNew ( ) ; $ task -> setTime ( trim ( $ matches [ 2 ] ) ) ; $ arguments = str_replace ( ' ' , ',' , trim ( $ matches [ 5 ] ) ) ; $ command = ucfirst ( $ matches [ 3 ] ) . '::' . $ matches [ 4 ] . '(' . $ arguments . ')' ; $ task -> setCommand ( $ command ) ; if ( ! empty ( $ comment ) ) { $ task -> setComment ( $ comment ) ; } //$output = $matches[7]; $ status = empty ( $ matches [ 1 ] ) ? TaskInterface :: TASK_STATUS_ACTIVE : TaskInterface :: TASK_STATUS_INACTIVE ; $ task -> setStatus ( $ status ) ; $ task -> setTs ( date ( 'Y-m-d H:i:s' ) ) ; $ task -> taskSave ( ) ; return $ task ; }
Creates new TaskInterface object from parsed crontab line
@param TaskInterface $task_class
@param array $matches
@param string $comment
@return TaskInterface
Creates new TaskInterface object from parsed crontab line