Пример #1
0
 /**
  * @return RequestedPhar[]
  * @throws CLI\CommandOptionsException
  */
 public function getRequestedPhars()
 {
     if ($this->cliOptions->getArgumentCount() == 0) {
         return $this->phiveXmlConfig->getPhars();
     }
     return $this->getPharsFromCliArguments();
 }
Пример #2
0
 /**
  *
  */
 public function execute()
 {
     if ($this->config->installGlobally()) {
         $targetDirectory = dirname($this->environment->getBinaryName());
     } else {
         $targetDirectory = $this->config->getWorkingDirectory();
     }
     foreach ($this->config->getRequestedPhars() as $requestedPhar) {
         $this->pharService->install($requestedPhar, $targetDirectory);
         if ($this->config->doNotAddToPhiveXml()) {
             continue;
         }
         $this->phiveXmlConfig->addPhar($requestedPhar);
     }
 }