Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
48383f9a
Commit
48383f9a
authored
Mar 28, 2014
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
app end improvement.
parent
43b8430e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
13 deletions
+5
-13
Application.php
framework/base/Application.php
+4
-4
ExitException.php
framework/base/ExitException.php
+1
-9
No files found.
framework/base/Application.php
View file @
48383f9a
...
@@ -597,13 +597,13 @@ abstract class Application extends Module
...
@@ -597,13 +597,13 @@ abstract class Application extends Module
}
}
/**
/**
* Terminates the application.
* Terminates the application.
* This method replaces the `exit()` function by ensuring the application life cycle is completed
* This method replaces the `exit()` function by ensuring the application life cycle is completed
* before terminating the application.
* 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.
* @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
* @throws ExitException if the application is in testing mode
*/
*/
public
function
end
(
$status
=
0
,
$response
=
null
)
public
function
end
(
$status
=
0
,
$response
=
null
)
{
{
if
(
$this
->
state
===
self
::
STATE_BEFORE_REQUEST
||
$this
->
state
===
self
::
STATE_HANDLING_REQUEST
)
{
if
(
$this
->
state
===
self
::
STATE_BEFORE_REQUEST
||
$this
->
state
===
self
::
STATE_HANDLING_REQUEST
)
{
...
...
framework/base/ExitException.php
View file @
48383f9a
...
@@ -15,7 +15,7 @@ namespace yii\base;
...
@@ -15,7 +15,7 @@ namespace yii\base;
* @author Qiang Xue <qiang.xue@gmail.com>
* @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0
* @since 2.0
*/
*/
class
ExitException
extends
Exception
class
ExitException
extends
\
Exception
{
{
/**
/**
* @var integer the exit status code
* @var integer the exit status code
...
@@ -35,12 +35,4 @@ class ExitException extends Exception
...
@@ -35,12 +35,4 @@ class ExitException extends Exception
$this
->
statusCode
=
$status
;
$this
->
statusCode
=
$status
;
parent
::
__construct
(
$message
,
$code
,
$previous
);
parent
::
__construct
(
$message
,
$code
,
$previous
);
}
}
/**
* @return string the user-friendly name of this exception
*/
public
function
getName
()
{
return
'Application Ended'
;
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment