Skip to content
This repository was archived by the owner on Sep 10, 2021. It is now read-only.

Commit 35b9045

Browse files
author
Jamie Snape
committed
Add optional debug toolbar for development
1 parent b702462 commit 35b9045

File tree

3 files changed

+29
-1
lines changed

3 files changed

+29
-1
lines changed

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"require-dev": {
2929
"ext-curl": "*",
3030
"fabpot/php-cs-fixer": "~1.1",
31+
"jokkedk/zfdebug": "~1.6.2",
3132
"phpcheckstyle/phpcheckstyle": "V0.14.1",
3233
"phpunit/dbunit": "1.3.*@dev",
3334
"phpunit/php-code-coverage": "~2.0.11",

core/Bootstrap.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,32 @@ protected function _initConfig()
164164
return $config;
165165
}
166166

167+
/** Display the debug toolbar, if enabled. */
168+
protected function _initZFDebug()
169+
{
170+
$this->bootstrap('config');
171+
$zfDebugPath = BASE_PATH.'/vendor/jokkedk/zfdebug/library';
172+
173+
if (Zend_Registry::get('configGlobal')->debug_toolbar === '1' && file_exists($zfDebugPath)) {
174+
set_include_path(get_include_path().PATH_SEPARATOR.$zfDebugPath);
175+
176+
$options = array(
177+
'plugins' => array('Variables',
178+
'Database' => array('adapter' => Zend_Registry::get('dbAdapter')),
179+
'Exception',
180+
'File' => array('basePath' => BASE_PATH),
181+
'Html',
182+
)
183+
);
184+
185+
$debug = new ZFDebug_Controller_Plugin_Debug($options);
186+
187+
$this->bootstrap('frontController');
188+
$frontController = $this->getResource('frontController');
189+
$frontController->registerPlugin($debug);
190+
}
191+
}
192+
167193
/** set up front */
168194
protected function _initFrontModules()
169195
{

core/configs/application.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ logtrace = 0
2323
password.prefix =
2424
; outbound HTTP proxy to be used by PHP (empty for none)
2525
httpproxy =
26+
; show debug toolbar
27+
debug_toolbar = 0
2628

2729
[module]
2830

@@ -40,7 +42,6 @@ mode.test = 0
4042
; Show native errors
4143
error.php = 1
4244

43-
4445
[testing]
4546
; Activate error reporting using Zend
4647
mode.debug = 1

0 commit comments

Comments
 (0)