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
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Rotua Panjaitan
yii2
Commits
80dbaaca
Commit
80dbaaca
authored
Mar 25, 2013
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fixes.
parent
379e48a4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
5 deletions
+14
-5
Application.php
framework/base/Application.php
+3
-0
ErrorHandler.php
framework/base/ErrorHandler.php
+4
-4
exception.php
framework/views/exception.php
+1
-1
Application.php
framework/web/Application.php
+6
-0
No files found.
framework/base/Application.php
View file @
80dbaaca
...
...
@@ -479,6 +479,9 @@ class Application extends Module
$msg
=
(
string
)
$e
;
$msg
.=
"
\n
Previous exception:
\n
"
;
$msg
.=
(
string
)
$exception
;
if
(
YII_DEBUG
)
{
echo
$msg
;
}
$msg
.=
"
\n\$
_SERVER = "
.
var_export
(
$_SERVER
,
true
);
error_log
(
$msg
);
exit
(
1
);
...
...
framework/base/ErrorHandler.php
View file @
80dbaaca
...
...
@@ -78,7 +78,7 @@ class ErrorHandler extends Component
if
(
isset
(
$_SERVER
[
'HTTP_X_REQUESTED_WITH'
])
&&
$_SERVER
[
'HTTP_X_REQUESTED_WITH'
]
===
'XMLHttpRequest'
)
{
\Yii
::
$app
->
renderException
(
$exception
);
}
else
{
$view
=
new
View
(
$this
)
;
$view
=
new
View
;
if
(
!
YII_DEBUG
||
$exception
instanceof
UserException
)
{
$viewName
=
$this
->
errorView
;
}
else
{
...
...
@@ -86,7 +86,7 @@ class ErrorHandler extends Component
}
echo
$view
->
render
(
$viewName
,
array
(
'exception'
=>
$exception
,
));
)
,
$this
);
}
}
else
{
\Yii
::
$app
->
renderException
(
$exception
);
...
...
@@ -255,8 +255,8 @@ class ErrorHandler extends Component
{
$view
=
new
View
;
$name
=
!
YII_DEBUG
||
$exception
instanceof
HttpException
?
$this
->
errorView
:
$this
->
exceptionView
;
echo
$view
->
render
(
$
this
,
$
name
,
array
(
echo
$view
->
render
(
$name
,
array
(
'exception'
=>
$exception
,
));
)
,
$this
);
}
}
framework/views/exception.php
View file @
80dbaaca
...
...
@@ -183,7 +183,7 @@ $title = $context->htmlEncode($exception instanceof \yii\base\Exception || $exce
<div class="
version
">
<?php echo date('Y-m-d H:i:s', time())?>
<?php echo YII_DEBUG ?
$context->
versionInfo
: ''?>
<?php echo YII_DEBUG ?
$context->
getVersionInfo
()
: ''?>
</div>
</div>
...
...
framework/web/Application.php
View file @
80dbaaca
...
...
@@ -6,6 +6,7 @@
*/
namespace
yii\web
;
use
yii\base\InvalidParamException
;
/**
...
...
@@ -17,6 +18,11 @@ use yii\base\InvalidParamException;
class
Application
extends
\yii\base\Application
{
/**
* @var string the default route of this application. Defaults to 'site'.
*/
public
$defaultRoute
=
'site'
;
/**
* Sets default path aliases.
*/
public
function
registerDefaultAliases
()
...
...
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