Commit 48383f9a by Qiang Xue

app end improvement.

parent 43b8430e
......@@ -597,13 +597,13 @@ abstract class Application extends Module
}
/**
* Terminates the application.
* This method replaces the `exit()` function by ensuring the application life cycle is completed
* Terminates the application.
* This method replaces the `exit()` function by ensuring the application life cycle is completed
* before terminating the application.
* @param integer $status the exit status (value 0 means normal exit while other values mean abnormal exit).
* @param integer $status the exit status (value 0 means normal exit while other values mean abnormal exit).
* @param Response $response the response to be sent. If not set, the default application [[response]] component will be used.
* @throws ExitException if the application is in testing mode
*/
*/
public function end($status = 0, $response = null)
{
if ($this->state === self::STATE_BEFORE_REQUEST || $this->state === self::STATE_HANDLING_REQUEST) {
......
......@@ -15,7 +15,7 @@ namespace yii\base;
* @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0
*/
class ExitException extends Exception
class ExitException extends \Exception
{
/**
* @var integer the exit status code
......@@ -35,12 +35,4 @@ class ExitException extends Exception
$this->statusCode = $status;
parent::__construct($message, $code, $previous);
}
/**
* @return string the user-friendly name of this exception
*/
public function getName()
{
return 'Application Ended';
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment