Deployer\Bootstrap\BootstrapByConfigFile::parseConfig PHP Метод

parseConfig() публичный Метод

public parseConfig ( ) : BootstrapByConfigFile
Результат BootstrapByConfigFile
    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;
    }

Usage Example

Пример #1
0
/**
 * Load server list file.
 * @param string $file
 */
function serverList($file)
{
    $bootstrap = new Bootstrap\BootstrapByConfigFile();
    $bootstrap->setConfig($file);
    $bootstrap->parseConfig();
    $bootstrap->initServers();
    $bootstrap->initClusters();
}