/** * Iterate the extension directories and return config.yaml files * * @return string[] */ public function collectConfigFiles() { $files = array(); // Load user file first. Its config values cannot be overwritten $userConfig = $this->pathProvider->getConfigPath() . '/config.yaml'; if (file_exists($userConfig)) { $files[] = $userConfig; } $extensionPath = $this->pathProvider->getExtensionPath(); $files = array_merge($files, $this->interateVendors($extensionPath)); // Load config.yaml.dist as latest - this way the fallback config options are defined $files[] = $this->pathProvider->getCliToolPath() . '/config.yaml.dist'; return $files; }
/** * Will return the path to the custom SSH key. Will return null if no * custom key is configured * * @return null|string * @throws \RuntimeException */ private function getCustomKey() { if (isset($this->config['sshKey'])) { $keyPath = $this->config['sshKey']; if (!file_exists($keyPath)) { throw new \RuntimeException("Could not find ssh key {$keyPath}"); } return $keyPath; } $packageKey = $this->pathProvider->getCliToolPath() . '/assets/ssh.key'; if (!file_exists($packageKey)) { return false; } $dir = $this->pathProvider->getRuntimeDir() . '/sw-cli-tools/'; $sshKeyFile = $dir . $this->keyFileName; if (file_exists($sshKeyFile) || $this->writeSshKey($dir, $packageKey)) { return $sshKeyFile; } return null; }