예제 #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;
 }
예제 #2
0
 /**
  * @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;
 }