public function init($config)
{
parent::init($config);
if ($this->getRequest()->getRequestResolved()) {
throw new TConfigurationException('urlmapping_global_required');
}
if ($this->_configFile !== null) {
$this->loadConfigFile();
}
$this->loadUrlMappings($config);
if ($this->_urlPrefix === '') {
$request = $this->getRequest();
if ($request->getUrlFormat() === THttpRequestUrlFormat::HiddenPath) {
$this->_urlPrefix = dirname($request->getApplicationUrl());
} else {
$this->_urlPrefix = $request->getApplicationUrl();
}
}
$this->_urlPrefix = rtrim($this->_urlPrefix, '/');
}