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
68cb074c
Commit
68cb074c
authored
Dec 26, 2013
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed #1504: Debug toolbar isn't loaded successfully in some environments when xdebug is enabled
parent
dcee382e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
19 deletions
+29
-19
CHANGELOG.md
extensions/yii/debug/CHANGELOG.md
+1
-1
DefaultController.php
extensions/yii/debug/controllers/DefaultController.php
+27
-18
CHANGELOG.md
framework/CHANGELOG.md
+1
-0
No files found.
extensions/yii/debug/CHANGELOG.md
View file @
68cb074c
...
@@ -4,7 +4,7 @@ Yii Framework 2 debug extension Change Log
...
@@ -4,7 +4,7 @@ Yii Framework 2 debug extension Change Log
2.
0.0 beta under development
2.
0.0 beta under development
----------------------------
----------------------------
-
no changes in this release.
-
Bug #1504: Debug toolbar isn't loaded successfully in some environments when xdebug is enabled (qiangxue)
2.
0.0 alpha, December 1, 2013
2.
0.0 alpha, December 1, 2013
-----------------------------
-----------------------------
...
...
extensions/yii/debug/controllers/DefaultController.php
View file @
68cb074c
...
@@ -64,7 +64,7 @@ class DefaultController extends Controller
...
@@ -64,7 +64,7 @@ class DefaultController extends Controller
public
function
actionToolbar
(
$tag
)
public
function
actionToolbar
(
$tag
)
{
{
$this
->
loadData
(
$tag
);
$this
->
loadData
(
$tag
,
3
);
return
$this
->
renderPartial
(
'toolbar'
,
[
return
$this
->
renderPartial
(
'toolbar'
,
[
'tag'
=>
$tag
,
'tag'
=>
$tag
,
'panels'
=>
$this
->
module
->
panels
,
'panels'
=>
$this
->
module
->
panels
,
...
@@ -78,9 +78,12 @@ class DefaultController extends Controller
...
@@ -78,9 +78,12 @@ class DefaultController extends Controller
private
$_manifest
;
private
$_manifest
;
protected
function
getManifest
()
protected
function
getManifest
(
$forceReload
=
false
)
{
{
if
(
$this
->
_manifest
===
null
)
{
if
(
$this
->
_manifest
===
null
||
$forceReload
)
{
if
(
$forceReload
)
{
clearstatcache
();
}
$indexFile
=
$this
->
module
->
dataPath
.
'/index.data'
;
$indexFile
=
$this
->
module
->
dataPath
.
'/index.data'
;
if
(
is_file
(
$indexFile
))
{
if
(
is_file
(
$indexFile
))
{
$this
->
_manifest
=
array_reverse
(
unserialize
(
file_get_contents
(
$indexFile
)),
true
);
$this
->
_manifest
=
array_reverse
(
unserialize
(
file_get_contents
(
$indexFile
)),
true
);
...
@@ -91,24 +94,30 @@ class DefaultController extends Controller
...
@@ -91,24 +94,30 @@ class DefaultController extends Controller
return
$this
->
_manifest
;
return
$this
->
_manifest
;
}
}
public
function
loadData
(
$tag
)
public
function
loadData
(
$tag
,
$maxRetry
=
0
)
{
{
$manifest
=
$this
->
getManifest
();
// retry loading debug data because the debug data is logged in shutdown function
if
(
isset
(
$manifest
[
$tag
]))
{
// which may be delayed in some environment if xdebug is enabled.
$dataFile
=
$this
->
module
->
dataPath
.
"/
$tag
.data"
;
// See: https://github.com/yiisoft/yii2/issues/1504
$data
=
unserialize
(
file_get_contents
(
$dataFile
));
for
(
$retry
=
0
;
$retry
<=
$maxRetry
;
++
$retry
)
{
foreach
(
$this
->
module
->
panels
as
$id
=>
$panel
)
{
$manifest
=
$this
->
getManifest
(
$retry
>
0
);
if
(
isset
(
$data
[
$id
]))
{
if
(
isset
(
$manifest
[
$tag
]))
{
$panel
->
tag
=
$tag
;
$dataFile
=
$this
->
module
->
dataPath
.
"/
$tag
.data"
;
$panel
->
load
(
$data
[
$id
]);
$data
=
unserialize
(
file_get_contents
(
$dataFile
));
}
else
{
foreach
(
$this
->
module
->
panels
as
$id
=>
$panel
)
{
// remove the panel since it has not received any data
if
(
isset
(
$data
[
$id
]))
{
unset
(
$this
->
module
->
panels
[
$id
]);
$panel
->
tag
=
$tag
;
$panel
->
load
(
$data
[
$id
]);
}
else
{
// remove the panel since it has not received any data
unset
(
$this
->
module
->
panels
[
$id
]);
}
}
}
$this
->
summary
=
$data
[
'summary'
];
return
;
}
}
$this
->
summary
=
$data
[
'summary'
];
}
else
{
throw
new
NotFoundHttpException
(
"Unable to find debug data tagged with '
$tag
'."
);
}
}
throw
new
NotFoundHttpException
(
"Unable to find debug data tagged with '
$tag
'."
);
}
}
}
}
framework/CHANGELOG.md
View file @
68cb074c
...
@@ -7,6 +7,7 @@ Yii Framework 2 Change Log
...
@@ -7,6 +7,7 @@ Yii Framework 2 Change Log
-
Bug #1446: Logging while logs are processed causes infinite loop (qiangxue)
-
Bug #1446: Logging while logs are processed causes infinite loop (qiangxue)
-
Bug #1497: Localized view files are not correctly returned (mintao)
-
Bug #1497: Localized view files are not correctly returned (mintao)
-
Bug #1500: Log messages exported to files are not separated by newlines (omnilight, qiangxue)
-
Bug #1500: Log messages exported to files are not separated by newlines (omnilight, qiangxue)
-
Bug #1504: Debug toolbar isn't loaded successfully in some environments when xdebug is enabled (qiangxue)
-
Bug #1509: The SQL for creating Postgres RBAC tables is incorrect (qiangxue)
-
Bug #1509: The SQL for creating Postgres RBAC tables is incorrect (qiangxue)
-
Bug #1545: It was not possible to execute db Query twice, params where missing (cebe)
-
Bug #1545: It was not possible to execute db Query twice, params where missing (cebe)
-
Bug #1550: fixed the issue that JUI input widgets did not property input IDs.
-
Bug #1550: fixed the issue that JUI input widgets did not property input IDs.
...
...
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