PHP Класс mult1mate\crontab\TaskManager

Автор: mult1mate
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
editTask ( mult1mate\crontab\TaskInterface $task, string $time, string $command, string $status = TaskInterface::TASK_STATUS_ACTIVE, string $comment = null ) : mult1mate\crontab\TaskInterface Edit and save TaskInterface object
getTaskCrontabLine ( mult1mate\crontab\TaskInterface $task, string $path, string $php_bin, string $input_file ) : string Formats task for export into crontab file
parseCommand ( string $command ) : array Parses command and returns an array which contains class, method and arguments of the command
parseCrontab ( string $cron, mult1mate\crontab\TaskInterface $task_class ) : array Parses each line of crontab content and creates new TaskInterface objects
validateCommand ( string $command ) : string | false Checks if the command is correct and removes spaces

Приватные методы

Метод Описание
createTaskWithCrontabLine ( mult1mate\crontab\TaskInterface $task_class, array $matches, string $comment ) : mult1mate\crontab\TaskInterface Creates new TaskInterface object from parsed crontab line

Описание методов

editTask() публичный статический Метод

Edit and save TaskInterface object
public static editTask ( mult1mate\crontab\TaskInterface $task, string $time, string $command, string $status = TaskInterface::TASK_STATUS_ACTIVE, string $comment = null ) : mult1mate\crontab\TaskInterface
$task mult1mate\crontab\TaskInterface
$time string
$command string
$status string
$comment string
Результат mult1mate\crontab\TaskInterface

getTaskCrontabLine() публичный статический Метод

Formats task for export into crontab file
public static getTaskCrontabLine ( mult1mate\crontab\TaskInterface $task, string $path, string $php_bin, string $input_file ) : string
$task mult1mate\crontab\TaskInterface
$path string
$php_bin string
$input_file string
Результат string

parseCommand() публичный статический Метод

Parses command and returns an array which contains class, method and arguments of the command
public static parseCommand ( string $command ) : array
$command string
Результат array

parseCrontab() публичный статический Метод

Parses each line of crontab content and creates new TaskInterface objects
public static parseCrontab ( string $cron, mult1mate\crontab\TaskInterface $task_class ) : array
$cron string
$task_class mult1mate\crontab\TaskInterface
Результат array

validateCommand() публичный статический Метод

Checks if the command is correct and removes spaces
public static validateCommand ( string $command ) : string | false
$command string
Результат string | false