public function getConfig($dir)
{
// load
try {
// all this stuff is not really necessary but this component is kewl
// and I want to use it.
// A better configuration handling => better programing
$delegatingLoader = new DelegatingLoader(new LoaderResolver(array(new Loader())));
$config = $delegatingLoader->load($dir);
} catch (FileLoaderLoadException $e) {
$config = array();
}
// validates
$processor = new Processor();
$configuration = new Validator();
try {
$processedConfig = $processor->processConfiguration($configuration, array($config));
} catch (InvalidConfigurationException $e) {
throw new \DomainException($e->getMessage());
}
return $processedConfig;
}