public function __construct($path)
{
if (is_file($path)) {
$this->configs[basename($path, '.yml')] = Yaml::parse($path);
} else {
$dir = new \DirectoryIterator($path);
foreach ($dir as $item) {
if ($item->isFile()) {
if (substr($item->getBasename(), -3) === 'yml') {
$this->configs[$item->getBasename('.yml')] = Yaml::parse($item->getRealPath());
}
}
}
$this->updatePaths();
// make sure that config.yml paths are absolute
}
}