first commit
This commit is contained in:
58
vendor/yiisoft/yii2/views/errorHandler/callStackItem.php
vendored
Normal file
58
vendor/yiisoft/yii2/views/errorHandler/callStackItem.php
vendored
Normal file
@ -0,0 +1,58 @@
|
||||
<?php
|
||||
/**
|
||||
* @var string|null $file
|
||||
* @var int|null $line
|
||||
* @var string|null $class
|
||||
* @var string|null $method
|
||||
* @var int $index
|
||||
* @var string[] $lines
|
||||
* @var int $begin
|
||||
* @var int $end
|
||||
* @var array $args
|
||||
* @var \yii\web\ErrorHandler $handler
|
||||
*/
|
||||
$html = <<<HTML
|
||||
IDE
|
||||
<svg class="icon icon--new-window" focusable="false" aria-hidden="true" width="16" height="16">
|
||||
<use href="#new-window"></use>
|
||||
</svg>
|
||||
HTML;
|
||||
?>
|
||||
<li class="<?= ($index === 1 || !$handler->isCoreFile($file)) ? 'application' : '' ?> call-stack-item"
|
||||
data-line="<?= (int) ($line - $begin) ?>">
|
||||
<div class="element-wrap">
|
||||
<div class="element">
|
||||
<span class="item-number"><?= (int) $index ?>.</span>
|
||||
<span class="text"><?= $file !== null ? 'in ' . $handler->htmlEncode($file) : '' ?></span>
|
||||
<?php if ($handler->traceLine !== '{html}'): ?>
|
||||
<span> – </span>
|
||||
<?= strtr($handler->traceLine, ['{file}' => $file, '{line}' => $line + 1, '{html}' => $html]) ?>
|
||||
<?php endif; ?>
|
||||
<span class="at">
|
||||
<?= $line !== null ? 'at line' : '' ?>
|
||||
<span class="line"><?= $line !== null ? $line + 1 : '' ?></span>
|
||||
</span>
|
||||
<?php if ($method !== null): ?>
|
||||
<span class="call">
|
||||
<?= $file !== null ? '–' : '' ?>
|
||||
<?= ($class !== null ? $handler->addTypeLinks("$class::$method") : $handler->htmlEncode($method)) . '(' . $handler->argumentsToString($args) . ')' ?>
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php if (!empty($lines)): ?>
|
||||
<div class="code-wrap">
|
||||
<div class="error-line"></div>
|
||||
<?php for ($i = $begin; $i <= $end; ++$i): ?><div class="hover-line"></div><?php endfor; ?>
|
||||
<div class="code">
|
||||
<?php for ($i = $begin; $i <= $end; ++$i): ?><span class="lines-item"><?= (int) ($i + 1) ?></span><?php endfor; ?>
|
||||
<pre><?php
|
||||
// fill empty lines with a whitespace to avoid rendering problems in opera
|
||||
for ($i = $begin; $i <= $end; ++$i) {
|
||||
echo (trim($lines[$i]) === '') ? " \n" : $handler->htmlEncode($lines[$i]);
|
||||
}
|
||||
?></pre>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</li>
|
||||
93
vendor/yiisoft/yii2/views/errorHandler/error.php
vendored
Normal file
93
vendor/yiisoft/yii2/views/errorHandler/error.php
vendored
Normal file
@ -0,0 +1,93 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \yii\web\View $this
|
||||
* @var \Throwable $exception
|
||||
* @var \yii\web\ErrorHandler $handler
|
||||
*/
|
||||
if ($exception instanceof \yii\web\HttpException) {
|
||||
$code = $exception->statusCode;
|
||||
} else {
|
||||
$code = $exception->getCode();
|
||||
}
|
||||
$name = $handler->getExceptionName($exception);
|
||||
if ($name === null) {
|
||||
$name = 'Error';
|
||||
}
|
||||
if ($code) {
|
||||
$name .= " (#$code)";
|
||||
}
|
||||
|
||||
if ($exception instanceof \yii\base\UserException) {
|
||||
$message = $exception->getMessage();
|
||||
} else {
|
||||
$message = 'An internal server error occurred.';
|
||||
}
|
||||
|
||||
if (method_exists($this, 'beginPage')) {
|
||||
$this->beginPage();
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title><?= $handler->htmlEncode($name) ?></title>
|
||||
|
||||
<style>
|
||||
body {
|
||||
font: normal 9pt "Verdana";
|
||||
color: #000;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font: normal 18pt "Verdana";
|
||||
color: #f00;
|
||||
margin-bottom: .5em;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font: normal 14pt "Verdana";
|
||||
color: #800000;
|
||||
margin-bottom: .5em;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font: bold 11pt "Verdana";
|
||||
}
|
||||
|
||||
p {
|
||||
font: normal 9pt "Verdana";
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.version {
|
||||
color: gray;
|
||||
font-size: 8pt;
|
||||
border-top: 1px solid #aaa;
|
||||
padding-top: 1em;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1><?= $handler->htmlEncode($name) ?></h1>
|
||||
<h2><?= nl2br($handler->htmlEncode($message)) ?></h2>
|
||||
<p>
|
||||
The above error occurred while the Web server was processing your request.
|
||||
</p>
|
||||
<p>
|
||||
Please contact us if you think this is a server error. Thank you.
|
||||
</p>
|
||||
<div class="version">
|
||||
<?= date('Y-m-d H:i:s') ?>
|
||||
</div>
|
||||
<?php if (method_exists($this, 'endBody')): ?>
|
||||
<?php $this->endBody() // to allow injecting code into body (mostly by Yii Debug Toolbar)?>
|
||||
<?php endif ?>
|
||||
</body>
|
||||
</html>
|
||||
<?php if (method_exists($this, 'endPage')): ?>
|
||||
<?php $this->endPage() ?>
|
||||
<?php endif ?>
|
||||
547
vendor/yiisoft/yii2/views/errorHandler/exception.php
vendored
Normal file
547
vendor/yiisoft/yii2/views/errorHandler/exception.php
vendored
Normal file
File diff suppressed because one or more lines are too long
25
vendor/yiisoft/yii2/views/errorHandler/previousException.php
vendored
Normal file
25
vendor/yiisoft/yii2/views/errorHandler/previousException.php
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \yii\base\Exception $exception
|
||||
* @var \yii\web\ErrorHandler $handler
|
||||
*/
|
||||
?>
|
||||
<div class="previous">
|
||||
<span class="arrow">↵</span>
|
||||
<h2>
|
||||
<span>Caused by:</span>
|
||||
<?php $name = $handler->getExceptionName($exception) ?>
|
||||
<?php if ($name !== null): ?>
|
||||
<span><?= $handler->htmlEncode($name) ?></span> –
|
||||
<?= $handler->addTypeLinks(get_class($exception)) ?>
|
||||
<?php else: ?>
|
||||
<span><?= $handler->htmlEncode(get_class($exception)) ?></span>
|
||||
<?php endif; ?>
|
||||
</h2>
|
||||
<h3><?= nl2br($handler->htmlEncode($exception->getMessage())) ?></h3>
|
||||
<p>in <span class="file"><?= $exception->getFile() ?></span> at line <span class="line"><?= $exception->getLine() ?></span></p>
|
||||
<?php if ($exception instanceof \yii\db\Exception && !empty($exception->errorInfo)): ?>
|
||||
<pre>Error Info: <?= $handler->htmlEncode(print_r($exception->errorInfo, true)) ?></pre>
|
||||
<?php endif ?>
|
||||
<?= $handler->renderPreviousExceptions($exception) ?>
|
||||
</div>
|
||||
Reference in New Issue
Block a user