示例#1
0
 /**
  * Get the handle matching a task.
  *
  * @param string       $slug
  * @param AbstractTask $task
  *
  * @return string|null
  */
 public function getTaskHandle($slug, AbstractTask $task = null)
 {
     $slug = $slug || !$task ? $slug : $task->getSlug();
     if ($slug === 'closure') {
         return;
     }
     return $slug;
 }
 /**
  * @param AbstractTask|null $task
  */
 public function __construct(AbstractTask $task = null)
 {
     parent::__construct();
     // If we passed a Task, bind its properties
     // to the command
     if ($task) {
         $this->task = $task;
         $this->task->command = $this;
         if (!$this->description && ($description = $task->getDescription())) {
             $this->setDescription($description);
         }
     }
 }
示例#3
0
 /**
  * @param AbstractTask $task
  * @param double[]     $past
  */
 protected function saveTaskTimes(AbstractTask $task, array $past)
 {
     $handle = sprintf('times.%s', $task->getSlug());
     $this->localStorage->set($handle, $past);
 }
示例#4
0
 /**
  * Get what the task does.
  *
  * @return string
  */
 public function getDescription()
 {
     $flattened = (array) $this->getStringTask();
     $flattened = implode('/', $flattened);
     return parent::getDescription() ?: $flattened;
 }
示例#5
0
 /**
  * @param Container $app
  */
 public function __construct(Container $app)
 {
     parent::__construct($app);
     $this->serverStorage = new ServerStorage($this->app, 'state');
 }
示例#6
0
 function __construct(Container $app, $drushPlugin)
 {
     parent::__construct($app);
     $this->drush = $this->binary($drushPlugin->binaryPath);
     $this->drushPlugin = $drushPlugin;
 }