private function parseConfiguration()
{
$configFiles = [sprintf('%s/config/%s', $this->container->getParameter('tutu.root_path'), 'config.yml'), sprintf('%s/config/%s', $this->container->getParameter('tutu.root_path'), 'config.yml.dist')];
if ($customPath = getenv('tutu_config')) {
if (!file_exists($customPath)) {
throw new \RuntimeException('Custom config file not found at ' . $customPath);
}
$configFiles = (array) $customPath;
}
foreach ($configFiles as $filePath) {
if ($filePath && file_exists($filePath) && ($config = Yaml::parse(file_get_contents($filePath)))) {
return $config;
}
}
return [];
}