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
14507bf6
Commit
14507bf6
authored
Jul 07, 2013
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor issue fixes.
parent
7a4572fd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
3 deletions
+19
-3
LogTarget.php
framework/yii/debug/LogTarget.php
+16
-0
LogPanel.php
framework/yii/debug/panels/LogPanel.php
+2
-2
RequestPanel.php
framework/yii/debug/panels/RequestPanel.php
+1
-1
No files found.
framework/yii/debug/LogTarget.php
View file @
14507bf6
...
...
@@ -57,6 +57,7 @@ class LogTarget extends Target
'ip'
=>
$request
->
getUserIP
(),
'time'
=>
time
(),
);
$this
->
gc
(
$manifest
);
$dataFile
=
"
$path
/
{
$this
->
tag
}
.json"
;
$data
=
array
();
...
...
@@ -82,4 +83,19 @@ class LogTarget extends Target
$this
->
export
(
$this
->
messages
);
}
}
protected
function
gc
(
&
$manifest
)
{
if
(
rand
(
0
,
100
)
<
5
&&
count
(
$manifest
)
>
$this
->
module
->
historySize
)
{
$n
=
count
(
$manifest
)
-
$this
->
module
->
historySize
;
foreach
(
array_keys
(
$manifest
)
as
$tag
)
{
$file
=
$this
->
module
->
dataPath
.
"/
$tag
.json"
;
@
unlink
(
$file
);
unset
(
$manifest
[
$tag
]);
if
(
--
$n
<=
0
)
{
break
;
}
}
}
}
}
framework/yii/debug/panels/LogPanel.php
View file @
14507bf6
...
...
@@ -29,11 +29,11 @@ class LogPanel extends Panel
$output
=
array
();
$errorCount
=
count
(
Target
::
filterMessages
(
$this
->
data
[
'messages'
],
Logger
::
LEVEL_ERROR
));
if
(
$errorCount
)
{
$output
[]
=
'<span class="label label-important">
$errorCount
</span> '
.
(
$errorCount
>
1
?
'errors'
:
'error'
);
$output
[]
=
'<span class="label label-important">
'
.
$errorCount
.
'
</span> '
.
(
$errorCount
>
1
?
'errors'
:
'error'
);
}
$warningCount
=
count
(
Target
::
filterMessages
(
$this
->
data
[
'messages'
],
Logger
::
LEVEL_WARNING
));
if
(
$warningCount
)
{
$output
[]
=
'<span class="label label-warning">
$warningCount
</span> '
.
(
$warningCount
>
1
?
'warnings'
:
'warning'
);
$output
[]
=
'<span class="label label-warning">
'
.
$warningCount
.
'
</span> '
.
(
$warningCount
>
1
?
'warnings'
:
'warning'
);
}
if
(
!
empty
(
$output
))
{
$log
=
implode
(
', '
,
$output
);
...
...
framework/yii/debug/panels/RequestPanel.php
View file @
14507bf6
...
...
@@ -107,7 +107,7 @@ EOD;
'flashes'
=>
$session
?
$session
->
getAllFlashes
()
:
array
(),
'requestHeaders'
=>
$requestHeaders
,
'responseHeaders'
=>
$responseHeaders
,
'route'
=>
Yii
::
$app
->
requestedAction
->
getUniqueId
()
,
'route'
=>
Yii
::
$app
->
requestedAction
?
Yii
::
$app
->
requestedAction
->
getUniqueId
()
:
Yii
::
$app
->
requestedRoute
,
'action'
=>
$action
,
'actionParams'
=>
Yii
::
$app
->
requestedParams
,
'SERVER'
=>
empty
(
$_SERVER
)
?
array
()
:
$_SERVER
,
...
...
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