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
731cbf89
Commit
731cbf89
authored
May 25, 2013
by
resurtm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New error page WIP.
parent
fa0022e7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
60 additions
and
55 deletions
+60
-55
SiteController.php
apps/bootstrap/controllers/SiteController.php
+3
-1
gears.png
apps/bootstrap/www/tmp/gears.png
+0
-0
main.css
apps/bootstrap/www/tmp/main.css
+14
-1
main.js
apps/bootstrap/www/tmp/main.js
+5
-2
ErrorHandler.php
framework/yii/base/ErrorHandler.php
+15
-1
callStackItem.php
framework/yii/views/errorHandler/callStackItem.php
+1
-1
main.php
framework/yii/views/errorHandler/main.php
+22
-49
No files found.
apps/bootstrap/controllers/SiteController.php
View file @
731cbf89
...
...
@@ -20,8 +20,10 @@ class SiteController extends Controller
public
function
actionIndex
()
{
$x
=
null
;
$x
->
y
=
100
;
throw
new
\yii\base\HttpException
(
500
,
'Test exception'
);
$x
=
1
;
//
$x = 1;
echo
$this
->
render
(
'index'
);
}
...
...
apps/bootstrap/www/tmp/gears.png
0 → 100644
View file @
731cbf89
4.47 KB
apps/bootstrap/www/tmp/main.css
View file @
731cbf89
...
...
@@ -50,6 +50,9 @@ h1,h2,p,img,ul li{
font-family
:
Arial
,
sans-serif
;
color
:
#505050
;
}
html
,
body
{
overflow-x
:
hidden
;
}
/* header */
.header
{
...
...
@@ -193,8 +196,18 @@ h1,h2,p,img,ul li{
margin-top
:
40px
;
margin-bottom
:
1px
;
}
.request
pre
{
.request
.code
{
min-width
:
860px
;
/* 960px - 50px * 2 */
max-width
:
1100px
;
/* 1200px - 50px * 2 */
margin
:
0
auto
;
padding
:
15px
50px
;
}
.request
.code
pre
{
line-height
:
18px
;
font-size
:
14px
;
font-family
:
Consolas
,
Courier
New
,
monospace
;
display
:
inline
;
word-wrap
:
break-word
;
}
/* footer */
...
...
apps/bootstrap/www/tmp/main.js
View file @
731cbf89
...
...
@@ -8,7 +8,7 @@ window.onload = function() {
hljs
.
highlightBlock
(
codeBlocks
[
i
],
' '
);
}
//
//
code block hover line
document
.
onmousemove
=
function
(
e
)
{
var
lines
,
i
,
imax
,
j
,
jmax
,
k
,
kmax
,
event
=
e
||
window
.
event
,
...
...
@@ -31,7 +31,10 @@ window.onload = function() {
hoverLines
[
k
].
className
=
'hover-line'
;
}
if
(
lineFound
)
{
Sizzle
(
'.call-stack-item:eq('
+
i
+
') .hover-line:eq('
+
j
+
')'
)[
0
].
className
=
'hover-line hover'
;
var
line
=
Sizzle
(
'.call-stack-item:eq('
+
i
+
') .hover-line:eq('
+
j
+
')'
);
if
(
line
[
0
])
{
line
[
0
].
className
=
'hover-line hover'
;
}
}
}
...
...
framework/yii/base/ErrorHandler.php
View file @
731cbf89
...
...
@@ -93,8 +93,22 @@ class ErrorHandler extends Component
if
(
YII_DEBUG
)
{
ini_set
(
'display_errors'
,
1
);
}
$view
=
new
View
();
echo
$view
->
renderFile
(
$this
->
mainView
,
array
(
'e'
=>
$exception
),
$this
);
$request
=
array
();
if
(
count
(
$_GET
)
>
0
)
{
$request
[]
=
'$_GET = '
.
var_export
(
$_GET
,
true
)
.
';'
;
}
if
(
count
(
$_POST
)
>
0
)
{
$request
[]
=
'$_POST = '
.
var_export
(
$_POST
,
true
)
.
';'
;
}
$request
[]
=
'$_SERVER = '
.
var_export
(
$_SERVER
,
true
)
.
';'
;
$request
=
implode
(
"
\n\n
"
,
$request
);
echo
$view
->
renderFile
(
$this
->
mainView
,
array
(
'e'
=>
$exception
,
'request'
=>
$request
,
'requestLinesCount'
=>
substr_count
(
$request
,
"
\n
"
),
),
$this
);
}
}
}
...
...
framework/yii/views/errorHandler/callStackItem.php
View file @
731cbf89
<?php
/**
* @var \yii\base\View $this
* @var \yii\base\ErrorHandler $c
* @var string $file
* @var integer $line
* @var integer $index
* @var string[] $lines
* @var integer $begin
* @var integer $end
* @var \yii\base\ErrorHandler $c
*/
$c
=
$this
->
context
;
?>
...
...
framework/yii/views/errorHandler/main.php
View file @
731cbf89
...
...
@@ -2,6 +2,8 @@
/**
* @var \yii\base\View $this
* @var \Exception $e
* @var string $request
* @var integer $requestLinesCount
* @var \yii\base\ErrorHandler $c
*/
$c
=
$this
->
context
;
...
...
@@ -27,14 +29,23 @@ $c = $this->context;
<body>
<div
class=
"header"
>
<img
src=
"/tmp/attention.png"
alt=
"Attention"
/>
<h1>
<span>
Exception
</span>
–
<?php
echo
$c
->
addTypeLinks
(
get_class
(
$e
));
?>
<?php
if
(
$e
instanceof
\yii\base\HttpException
)
:
?>
–
<?php
echo
$c
->
createHttpStatusLink
(
$e
->
statusCode
);
?>
<?php
endif
;
?>
</h1>
<h2>
<?php
echo
$c
->
htmlEncode
(
$e
->
getName
());
?>
</h2>
<?php
if
(
$e
instanceof
\yii\base\ErrorException
)
:
?>
<img
src=
"/tmp/gears.png"
alt=
"Gears"
/>
<h1>
<span>
<?php
echo
$c
->
htmlEncode
(
$e
->
getName
());
?>
</span>
–
<?php
echo
$c
->
addTypeLinks
(
get_class
(
$e
));
?>
</h1>
<h2>
<?php
echo
$c
->
htmlEncode
(
$e
->
getMessage
());
?>
</h2>
<?php
else
:
?>
<img
src=
"/tmp/attention.png"
alt=
"Attention"
/>
<h1>
<span>
Exception
</span>
–
<?php
echo
$c
->
addTypeLinks
(
get_class
(
$e
));
?>
<?php
if
(
$e
instanceof
\yii\base\HttpException
)
:
?>
–
<?php
echo
$c
->
createHttpStatusLink
(
$e
->
statusCode
);
?>
<?php
endif
;
?>
</h1>
<h2>
<?php
echo
$c
->
htmlEncode
(
$e
->
getName
());
?>
</h2>
<?php
endif
;
?>
</div>
<div
class=
"call-stack"
>
...
...
@@ -46,49 +57,11 @@ $c = $this->context;
</ul>
</div>
<?php
/*
<div
class=
"request"
>
<div id="code-wrap"></div>
<div id="code-highlighter"></div>
<div id="code-inner-wrap">
<pre id="code">$_GET = [
'show-post' => 100,
'refresh-page' => 'yes',
'ascending-sort' => 1,
];
$_POST = [
'blog-post-form' => [
'title' => 'hello',
'author_id' => '12',
],
];
$_SERVER = [
'DOCUMENT_ROOT' => '/home/resurtm/work/data',
'REMOTE_ADDR' => '::1',
'REMOTE_PORT' => '52694',
'SERVER_SOFTWARE' => 'PHP 5.4.3 Development Server',
'SERVER_PROTOCOL' => 'HTTP/1.1',
'SERVER_NAME' => 'localhost',
'SERVER_PORT' => '8000',
'REQUEST_URI' => '/index.php?post-form[title]=hello&post-form[author_id]=12',
'REQUEST_METHOD' => 'GET',
'SCRIPT_NAME' => '/index.php',
'SCRIPT_FILENAME' => '/home/resurtm/work/data/index.php',
'PHP_SELF' => '/index.php',
'QUERY_STRING' => 'post-form[title]=hello&post-form[author_id]=12',
'HTTP_HOST' => 'localhost:8000',
'HTTP_USER_AGENT' => 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:20.0) Gecko/20100101 Firefox/20.0',
'HTTP_ACCEPT_LANGUAGE' => 'ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3',
'HTTP_ACCEPT_ENCODING' => 'gzip, deflate',
'HTTP_CONNECTION' => 'keep-alive',
'REQUEST_TIME_FLOAT' => 1369146454.0856,
'REQUEST_TIME' => 1369146454,
];</pre>
<div
class=
"code"
>
<pre>
<?php
echo
$c
->
htmlEncode
(
$request
);
?>
</pre>
</div>
</div>
</div>*/
?>
</div>
<div
class=
"footer"
>
<img
src=
"/tmp/logo.png"
alt=
"Yii Framework"
/>
...
...
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