public function init($config)
{
if ($this->_configFile !== null) {
if (is_file($this->_configFile)) {
if ($this->getApplication()->getConfigurationType() == TApplication::CONFIG_TYPE_PHP) {
$phpConfig = (include $this->_configFile);
$this->loadConfig($phpConfig);
} else {
$dom = new TXmlDocument();
$dom->loadFromFile($this->_configFile);
$this->loadConfig($dom);
}
} else {
throw new TConfigurationException('logrouter_configfile_invalid', $this->_configFile);
}
}
$this->loadConfig($config);
$this->getApplication()->attachEventHandler('OnEndRequest', array($this, 'collectLogs'));
}