mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-17 06:48:59 +08:00
bug fixes.
This commit is contained in:
@@ -479,6 +479,9 @@ class Application extends Module
|
|||||||
$msg = (string)$e;
|
$msg = (string)$e;
|
||||||
$msg .= "\nPrevious exception:\n";
|
$msg .= "\nPrevious exception:\n";
|
||||||
$msg .= (string)$exception;
|
$msg .= (string)$exception;
|
||||||
|
if (YII_DEBUG) {
|
||||||
|
echo $msg;
|
||||||
|
}
|
||||||
$msg .= "\n\$_SERVER = " . var_export($_SERVER, true);
|
$msg .= "\n\$_SERVER = " . var_export($_SERVER, true);
|
||||||
error_log($msg);
|
error_log($msg);
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ class ErrorHandler extends Component
|
|||||||
if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] === 'XMLHttpRequest') {
|
if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] === 'XMLHttpRequest') {
|
||||||
\Yii::$app->renderException($exception);
|
\Yii::$app->renderException($exception);
|
||||||
} else {
|
} else {
|
||||||
$view = new View($this);
|
$view = new View;
|
||||||
if (!YII_DEBUG || $exception instanceof UserException) {
|
if (!YII_DEBUG || $exception instanceof UserException) {
|
||||||
$viewName = $this->errorView;
|
$viewName = $this->errorView;
|
||||||
} else {
|
} else {
|
||||||
@@ -86,7 +86,7 @@ class ErrorHandler extends Component
|
|||||||
}
|
}
|
||||||
echo $view->render($viewName, array(
|
echo $view->render($viewName, array(
|
||||||
'exception' => $exception,
|
'exception' => $exception,
|
||||||
));
|
), $this);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
\Yii::$app->renderException($exception);
|
\Yii::$app->renderException($exception);
|
||||||
@@ -255,8 +255,8 @@ class ErrorHandler extends Component
|
|||||||
{
|
{
|
||||||
$view = new View;
|
$view = new View;
|
||||||
$name = !YII_DEBUG || $exception instanceof HttpException ? $this->errorView : $this->exceptionView;
|
$name = !YII_DEBUG || $exception instanceof HttpException ? $this->errorView : $this->exceptionView;
|
||||||
echo $view->render($this, $name, array(
|
echo $view->render($name, array(
|
||||||
'exception' => $exception,
|
'exception' => $exception,
|
||||||
));
|
), $this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ $title = $context->htmlEncode($exception instanceof \yii\base\Exception || $exce
|
|||||||
|
|
||||||
<div class="version">
|
<div class="version">
|
||||||
<?php echo date('Y-m-d H:i:s', time())?>
|
<?php echo date('Y-m-d H:i:s', time())?>
|
||||||
<?php echo YII_DEBUG ? $context->versionInfo : ''?>
|
<?php echo YII_DEBUG ? $context->getVersionInfo() : ''?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
namespace yii\web;
|
namespace yii\web;
|
||||||
|
|
||||||
use yii\base\InvalidParamException;
|
use yii\base\InvalidParamException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -16,6 +17,11 @@ use yii\base\InvalidParamException;
|
|||||||
*/
|
*/
|
||||||
class Application extends \yii\base\Application
|
class Application extends \yii\base\Application
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* @var string the default route of this application. Defaults to 'site'.
|
||||||
|
*/
|
||||||
|
public $defaultRoute = 'site';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets default path aliases.
|
* Sets default path aliases.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user