Beispiel #1
0
 public static function add($method, $directory, $exec_time = Null)
 {
     $ent_task = self::getTable()->newEntity();
     if (is_null($exec_time)) {
         new \DateTime('now');
     } else {
         if (!is_string($exec_time)) {
             $ent_task->exec_time = $exec_time;
         } else {
             \DateTime::createFromFormat('HH:ii d-m-Y', $exec_time);
         }
     }
     $ent_task->status = TaskStatus::WAIT;
     $ent_task->method = $method;
     $ent_task->directory = $directory;
     $task = new Task($ent_task);
     $task->save();
     return $task;
 }
Beispiel #2
0
 public function geturl($path)
 {
     $this->out('Generating link... ', 0, Shell::QUIET);
     $this->_io->overwrite('Generated link: ' . Task::getUrlBase($path), 1);
 }
Beispiel #3
0
 public function image($file)
 {
     Task::getUrlBase($this->Url->img($file));
 }
Beispiel #4
0
 public function process()
 {
     return Task::tick();
 }
Beispiel #5
0
 public function main($task)
 {
     Task::init_and_execute($task);
 }