public function parsePluginConfigs()
{
$finder = Finder::create()->in($this['config']['plugin_realdir'])->directories()->depth(0);
$finder->sortByName();
$pluginConfigs = array();
foreach ($finder as $dir) {
$code = $dir->getBaseName();
$file = $dir->getRealPath() . '/config.yml';
$config = null;
if (file_exists($file)) {
$config = Yaml::parse(file_get_contents($file));
} else {
$this['monolog']->warning("skip {$code} orm.path loading. config.yml not found.", array('path' => $file));
continue;
}
$file = $dir->getRealPath() . '/event.yml';
$event = null;
if (file_exists($file)) {
$event = Yaml::parse(file_get_contents($file));
} else {
$this['monolog']->info("skip {$code} event.yml not found.", array('path' => $file));
}
if (!is_null($config)) {
$pluginConfigs[$code] = array('config' => $config, 'event' => $event);
$this['monolog']->debug("parse {$code} config", array($code => $pluginConfigs[$code]));
}
}
return $pluginConfigs;
}