@ -151,10 +153,10 @@ abstract class Application extends Module
*/
*/
public function run()
public function run()
{
{
if ($this->hasEventHandler('onBeginRequest'))
if ($this->hasEventHandlers('onBeginRequest'))
$this->onBeginRequest(new CEvent($this));
$this->onBeginRequest(new CEvent($this));
$this->processRequest();
$this->processRequest();
if ($this->hasEventHandler('onEndRequest'))
if ($this->hasEventHandlers('onEndRequest'))
$this->onEndRequest(new CEvent($this));
$this->onEndRequest(new CEvent($this));
}
}
@ -168,7 +170,7 @@ abstract class Application extends Module
*/
*/
public function end($status = 0, $exit = true)
public function end($status = 0, $exit = true)
{
{
if ($this->hasEventHandler('onEndRequest'))
if ($this->hasEventHandlers('onEndRequest'))
$this->onEndRequest(new CEvent($this));
$this->onEndRequest(new CEvent($this));
if ($exit)
if ($exit)
exit($status);
exit($status);
@ -235,7 +237,7 @@ abstract class Application extends Module
public function setBasePath($path)
public function setBasePath($path)
{
{
if (($this->_basePath = realpath($path)) === false || !is_dir($this->_basePath))
if (($this->_basePath = realpath($path)) === false || !is_dir($this->_basePath))
throw new CException(Yii::t('yii', 'Application base path "{path}" is not a valid directory.',
throw new \yii\base\Exception(\Yii::t('yii', 'Application base path "{path}" is not a valid directory.',
array('{path}' => $path)));
array('{path}' => $path)));
}
}
@ -262,7 +264,7 @@ abstract class Application extends Module
public function setRuntimePath($path)
public function setRuntimePath($path)
{
{
if (($runtimePath = realpath($path)) === false || !is_dir($runtimePath) || !is_writable($runtimePath))
if (($runtimePath = realpath($path)) === false || !is_dir($runtimePath) || !is_writable($runtimePath))
throw new CException(Yii::t('yii', 'Application runtime path "{path}" is not valid. Please make sure it is a directory writable by the Web server process.',
throw new \yii\base\Exception(\Yii::t('yii', 'Application runtime path "{path}" is not valid. Please make sure it is a directory writable by the Web server process.',
array('{path}' => $path)));
array('{path}' => $path)));
$this->_runtimePath = $runtimePath;
$this->_runtimePath = $runtimePath;
}
}
@ -273,7 +275,7 @@ abstract class Application extends Module
*/
*/
public function getExtensionPath()
public function getExtensionPath()
{
{
return Yii::getPathOfAlias('ext');
return \Yii::getPathOfAlias('ext');
}
}
/**
/**
@ -283,9 +285,9 @@ abstract class Application extends Module
public function setExtensionPath($path)
public function setExtensionPath($path)
{
{
if (($extensionPath = realpath($path)) === false || !is_dir($extensionPath))
if (($extensionPath = realpath($path)) === false || !is_dir($extensionPath))
throw new CException(Yii::t('yii', 'Extension path "{path}" does not exist.',
throw new \yii\base\Exception(\Yii::t('yii', 'Extension path "{path}" does not exist.',
array('{path}' => $path)));
array('{path}' => $path)));
Yii::setPathOfAlias('ext', $extensionPath);
\Yii::setAlias('ext', $extensionPath);
}
}
/**
/**
@ -386,7 +388,7 @@ abstract class Application extends Module