Пример #1
0
 /**
  * Initialize parameters.
  *
  * @throws SkipException
  */
 public function init()
 {
     parent::init();
     if (!is_null($this->getParameter('checkPathsExist'))) {
         $this->setCheckPathsExist($this->getParameter('checkPathsExist'));
     }
     if (!$this->getParameter('paths')) {
         throw new SkipException('Param paths is mandatory');
     }
     $this->setPaths(is_array($this->getParameter('paths')) ? $this->getParameter('paths') : explode(PATH_SEPARATOR, $this->getParameter('paths', '')));
     if (!is_null($owner = $this->getParameter('owner'))) {
         if (strpos($owner, ':') !== false) {
             $this->setOwner(array_shift(explode(':', $owner)));
             $this->setGroup(array_pop(explode(':', $owner)));
         } else {
             $this->setOwner($owner);
         }
     }
     if (!is_null($group = $this->getParameter('group'))) {
         $this->setGroup($group);
     }
     if (!is_null($rights = $this->getParameter('rights'))) {
         $this->setRights($rights);
     }
     if (!is_null($recursive = $this->getParameter('recursive'))) {
         $this->setRecursive($recursive);
     }
 }
Пример #2
0
 /**
  * Initialize parameters.
  *
  * @throws RequiredConfigNotFoundException
  */
 function init()
 {
     parent::init();
     if (!$this->getParameter('source')) {
         throw new RequiredConfigNotFoundException('Missing required source path.');
     }
     $this->setSource($this->getParameter('source'));
 }
Пример #3
0
 /**
  * Initialize parameters.
  *
  * @throws RequiredConfigNotFoundException
  */
 function init()
 {
     parent::init();
     if (!($this->repo = $this->getParameter('repo'))) {
         throw new RequiredConfigNotFoundException('Missing required repository link.');
     }
     $this->branch = $this->getParameter('branch', 'master');
 }
Пример #4
0
 /**
  * Initialize parameters.
  *
  * @throws RequiredConfigNotFoundException
  */
 public function init()
 {
     parent::init();
     if (!$this->getParameter('target')) {
         throw new RequiredConfigNotFoundException('Missing required target link.');
     }
     $this->setTarget($this->getParameter('target'));
     if (!is_null($this->getParameter('link'))) {
         $this->setLink($this->getParameter('link'));
     }
 }
Пример #5
0
 /**
  * Initialize parameters.
  *
  * @throws RequiredConfigNotFoundException
  */
 function init()
 {
     parent::init();
     if (!$this->getParameter('service') and !$this->getParameter('serviceD')) {
         throw new RequiredConfigNotFoundException('Missing required service or serviced name.');
     }
     if ($this->getParameter('service') and $this->getParameter('serviceD')) {
         throw new RequiredConfigNotFoundException('Remove service accepts service or serviceD parameter, not both.');
     }
     if (!$this->getParameter('command')) {
         throw new RequiredConfigNotFoundException('Missing required command for service.');
     }
     $this->service = $this->getParameter('service');
     $this->serviceD = $this->getParameter('serviceD');
     $this->command = $this->getParameter('command');
 }
Пример #6
0
 /**
  * Initialize parameters.
  *
  * @throws SkipException
  */
 public function init()
 {
     parent::init();
     if (!is_null($this->getParameter('checkPathsExist'))) {
         $this->setCheckPathsExist($this->getParameter('checkPathsExist'));
     }
     if (!$this->getParameter('paths')) {
         throw new SkipException('Param paths is mandatory');
     }
     $this->setPaths(is_array($this->getParameter('paths')) ? $this->getParameter('paths') : explode(PATH_SEPARATOR, $this->getParameter('paths', '')));
     if (!is_null($recursive = $this->getParameter('recursive'))) {
         $this->setRecursive($recursive);
     }
     if (!is_null($force = $this->getParameter('force'))) {
         $this->setForce($force);
     }
 }
Пример #7
0
 /**
  * Runs a Task
  *
  * @param AbstractTask $task
  * @param string $title
  * @return boolean
  */
 protected function runTask(AbstractTask $task, $title = null)
 {
     $task->init();
     if ($title == null) {
         $title = 'Running <purple>' . $task->getName() . '</purple> ... ';
     }
     Console::output($title, 2, 0);
     $runTask = true;
     if ($task instanceof SkipOnOverride && $this->getConfig()->getParameter('overrideRelease', false)) {
         $runTask = false;
     }
     if ($runTask == true) {
         try {
             $result = $task->run();
             if ($result == true) {
                 Console::output('<green>OK</green>', 0);
                 $result = true;
             } else {
                 Console::output('<red>FAIL</red>', 0);
                 $result = false;
             }
         } catch (ErrorWithMessageException $e) {
             Console::output('<red>FAIL</red> [Message: ' . $e->getMessage() . ']', 0);
             $result = false;
         } catch (SkipException $e) {
             Console::output('<yellow>SKIPPED</yellow>', 0);
             $result = true;
         } catch (Exception $e) {
             Console::output('<red>FAIL</red>', 0);
             $result = false;
         }
     } else {
         Console::output('<yellow>SKIPPED</yellow>', 0);
         $result = true;
     }
     return $result;
 }