20 return $this->getModule()->owner;
29 return $this->getModule()->owner;
37 $this->render(
'index', array(
52 $this->redirect(array(
'view',
'tag' => $tag,
'panel' => $panel));
55 if (isset($this->component->panels[$panel])) {
56 $activePanel = $this->
getOwner()->panels[$panel];
58 $activePanel = $this->
getOwner()->panels[
'request'];
60 $this->render(
'view', array(
62 'summary' => $this->summary,
64 'panels' => $this->
getOwner()->panels,
65 'activePanel' => $activePanel,
75 $lock = $this->
getOwner()->getLock($tag);
76 $this->
getOwner()->setLock($tag, !$lock);
91 $dbPanel = $this->
getOwner()->panels[
'db'];
93 throw new Exception(
'Yii2DbPanel not found');
95 if (!$dbPanel->canExplain) {
96 throw new CHttpException(403,
'Forbidden');
98 $message = $dbPanel->messageByNum($num);
99 if ($message === null) {
100 throw new Exception(
"Not found query by number $num");
102 $query = $dbPanel->formatSql($message,
true);
104 $db = Yii::app()->getComponent($connection);
106 if (!Yii::app()->request->isAjaxRequest) {
107 $this->
getOwner()->setLock($tag,
true);
108 $this->render(
'explain', array(
110 'summary' => $this->summary,
112 'panels' => $this->
getOwner()->panels,
113 'dbPanel' => $dbPanel,
119 $this->renderPartial(
'_explain', array(
133 $this->renderPartial(
'toolbar', array(
135 'panels' => $this->
getOwner()->panels,
148 if ($this->_manifest === null) {
150 $indexFile =
"$path/index.data";
151 if (is_file($indexFile)) {
152 $this->_manifest = array_reverse(unserialize(file_get_contents($indexFile)),
true);
154 $this->_manifest = array();
163 if (isset($manifest[$tag])) {
165 $dataFile =
"$path/$tag.data";
166 $data = unserialize(file_get_contents($dataFile));
167 foreach ($this->
getOwner()->panels as $id => $panel) {
168 if (isset(
$data[$id])) {
169 $panel->load(
$data[$id], $tag);
172 unset($this->
getOwner()->panels[$id]);
175 $this->summary =
$data[
'summary'];
177 throw new CHttpException(404,
"Unable to find debug data tagged with '$tag'.");
183 if (!$this->
getOwner()->showConfig) {
184 throw new CHttpException(403,
'Forbidden');
186 $components = array();
187 foreach (Yii::app()->getComponents(
false) as $id =>
$config) {
189 $components[$id] = Yii::app()->getComponent($id);
190 }
catch (Exception $e) {
192 $components[$id] = array_merge(
$config, array(
193 '_error_' => $e->getMessage(),
198 $modules = Yii::app()->modules;
207 $this->
getOwner()->hiddenConfigOptions
209 $this->render(
'config',
$data);
219 foreach ($options as $option) {
221 foreach (explode(
'/', $option) as $key) {
222 if (is_array($item) && isset($item[$key])) {
223 $item = &$item[$key];
230 $item =
'**********';