public parseConfig ( ) : |
||
Résultat |
public function parseConfig()
{
try {
$this->configFileContent = Yaml::parse(file_get_contents($this->configFile));
} catch (\RuntimeException $e) {
throw new \RuntimeException("Error in parsing " . $this->configFile . " file.");
}
foreach ($this->configFileContent as $key => $cnf) {
if (isset($cnf['cluster']) && $cnf['cluster']) {
$this->clusterConfig[$key] = $cnf;
} else {
$this->serverConfig[$key] = $cnf;
}
}
return $this;
}
/** * Load server list file. * @param string $file */ function serverList($file) { $bootstrap = new Bootstrap\BootstrapByConfigFile(); $bootstrap->setConfig($file); $bootstrap->parseConfig(); $bootstrap->initServers(); $bootstrap->initClusters(); }