/** * @param IO $io */ protected function parseConfig(IO $io) { $configFile = __DIR__ . '/../../../etc/config.yml'; if (file_exists($configFile) && is_file($configFile)) { $config = Yaml::parse(file_get_contents($configFile)); try { $this->profile = Profile::fromArray($config); } catch (\InvalidArgumentException $e) { $io->errorLine("Invalid config.yml file"); exit; } } else { $io->errorLine("No config.yml file"); exit; } }
/** * @param Profile $profile */ public function __construct(Profile $profile) { $this->host = $profile->getHost(); $this->user = $profile->getUser(); $this->password = $profile->getPassword(); }
/** * @param Profile $profile */ function __construct(Profile $profile) { $this->url = "http://" . $profile->getHost() . "/web/"; }