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
b9de474c
Commit
b9de474c
authored
Oct 17, 2013
by
Eugene Kuzminov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debug panel : change json_encode/decode to serialise/unserialise to prevent…
debug panel : change json_encode/decode to serialise/unserialise to prevent non-UTF characters error
parent
f716bdd7
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
LogTarget.php
framework/yii/debug/LogTarget.php
+3
-3
DefaultController.php
framework/yii/debug/controllers/DefaultController.php
+2
-2
RequestPanel.php
framework/yii/debug/panels/RequestPanel.php
+1
-1
No files found.
framework/yii/debug/LogTarget.php
View file @
b9de474c
...
@@ -49,7 +49,7 @@ class LogTarget extends Target
...
@@ -49,7 +49,7 @@ class LogTarget extends Target
if
(
!
is_file
(
$indexFile
))
{
if
(
!
is_file
(
$indexFile
))
{
$manifest
=
array
();
$manifest
=
array
();
}
else
{
}
else
{
$manifest
=
json_decode
(
file_get_contents
(
$indexFile
),
true
);
$manifest
=
unserialize
(
file_get_contents
(
$indexFile
)
);
}
}
$request
=
Yii
::
$app
->
getRequest
();
$request
=
Yii
::
$app
->
getRequest
();
$manifest
[
$this
->
tag
]
=
$summary
=
array
(
$manifest
[
$this
->
tag
]
=
$summary
=
array
(
...
@@ -68,8 +68,8 @@ class LogTarget extends Target
...
@@ -68,8 +68,8 @@ class LogTarget extends Target
$data
[
$id
]
=
$panel
->
save
();
$data
[
$id
]
=
$panel
->
save
();
}
}
$data
[
'summary'
]
=
$summary
;
$data
[
'summary'
]
=
$summary
;
file_put_contents
(
$dataFile
,
json_encod
e
(
$data
));
file_put_contents
(
$dataFile
,
serializ
e
(
$data
));
file_put_contents
(
$indexFile
,
json_encod
e
(
$manifest
));
file_put_contents
(
$indexFile
,
serializ
e
(
$manifest
));
}
}
/**
/**
...
...
framework/yii/debug/controllers/DefaultController.php
View file @
b9de474c
...
@@ -76,7 +76,7 @@ class DefaultController extends Controller
...
@@ -76,7 +76,7 @@ class DefaultController extends Controller
if
(
$this
->
_manifest
===
null
)
{
if
(
$this
->
_manifest
===
null
)
{
$indexFile
=
$this
->
module
->
dataPath
.
'/index.json'
;
$indexFile
=
$this
->
module
->
dataPath
.
'/index.json'
;
if
(
is_file
(
$indexFile
))
{
if
(
is_file
(
$indexFile
))
{
$this
->
_manifest
=
array_reverse
(
json_decode
(
file_get_contents
(
$indexFile
),
true
),
true
);
$this
->
_manifest
=
array_reverse
(
unserialize
(
file_get_contents
(
$indexFile
)
),
true
);
}
else
{
}
else
{
$this
->
_manifest
=
array
();
$this
->
_manifest
=
array
();
}
}
...
@@ -89,7 +89,7 @@ class DefaultController extends Controller
...
@@ -89,7 +89,7 @@ class DefaultController extends Controller
$manifest
=
$this
->
getManifest
();
$manifest
=
$this
->
getManifest
();
if
(
isset
(
$manifest
[
$tag
]))
{
if
(
isset
(
$manifest
[
$tag
]))
{
$dataFile
=
$this
->
module
->
dataPath
.
"/
$tag
.json"
;
$dataFile
=
$this
->
module
->
dataPath
.
"/
$tag
.json"
;
$data
=
json_decode
(
file_get_contents
(
$dataFile
),
true
);
$data
=
unserialize
(
file_get_contents
(
$dataFile
)
);
foreach
(
$this
->
module
->
panels
as
$id
=>
$panel
)
{
foreach
(
$this
->
module
->
panels
as
$id
=>
$panel
)
{
if
(
isset
(
$data
[
$id
]))
{
if
(
isset
(
$data
[
$id
]))
{
$panel
->
tag
=
$tag
;
$panel
->
tag
=
$tag
;
...
...
framework/yii/debug/panels/RequestPanel.php
View file @
b9de474c
...
@@ -151,7 +151,7 @@ EOD;
...
@@ -151,7 +151,7 @@ EOD;
}
}
$rows
=
array
();
$rows
=
array
();
foreach
(
$values
as
$name
=>
$value
)
{
foreach
(
$values
as
$name
=>
$value
)
{
$rows
[]
=
'<tr><th style="width: 200px;">'
.
Html
::
encode
(
$name
)
.
'</th><td>'
.
Html
::
encode
(
var_export
(
$value
,
true
)
)
.
'</td></tr>'
;
$rows
[]
=
'<tr><th style="width: 200px;">'
.
Html
::
encode
(
$name
)
.
'</th><td>'
.
htmlspecialchars
(
var_export
(
$value
,
true
),
ENT_QUOTES
|
ENT_SUBSTITUTE
,
\Yii
::
$app
->
charset
,
TRUE
)
.
'</td></tr>'
;
}
}
$rows
=
implode
(
"
\n
"
,
$rows
);
$rows
=
implode
(
"
\n
"
,
$rows
);
return
<<<EOD
return
<<<EOD
...
...
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