public static function create(GlobalConfiguration $globalConfiguration, $name, ApplicationConfiguration $applicationConfiguration) { try { $globalConfiguration->getVhostConfiguration($name); throw new VhostExistsException($name); } catch (NoSuchVhostException $ex) { $config = new self($globalConfiguration, $name); $config->setApplication($applicationConfiguration->getName()); $config->setDisabled(false); return $config; } }
public static function fromConfig(GlobalConfiguration $globalConfiguration, ApplicationConfiguration $config) { return new self($globalConfiguration, $config->getName()); }
private function getRepositoryName(ApplicationConfiguration $applicationConfig) { $configHelper = $this->getHelper('configuration'); /* @var $configHelper GlobalConfigurationHelper */ $repoName = $applicationConfig->getRepository(); if (!$repoName) { return '<comment>None</comment>'; } if (!Util::isSshRepositoryUrl($repoName)) { return $repoName; } try { $repoConfig = $configHelper->getConfiguration()->getRepositoryConfiguration($repoName); if (is_file($repoConfig->getIdentityFile())) { return $repoName; } } catch (NoSuchRepositoryException $ex) { // no op } return sprintf('<error>%s</error>', $repoName); }