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

Commit

Permalink
Add optional debug toolbar for development
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamie Snape committed Nov 20, 2014
1 parent b702462 commit 35b9045
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"require-dev": {
"ext-curl": "*",
"fabpot/php-cs-fixer": "~1.1",
"jokkedk/zfdebug": "~1.6.2",
"phpcheckstyle/phpcheckstyle": "V0.14.1",
"phpunit/dbunit": "1.3.*@dev",
"phpunit/php-code-coverage": "~2.0.11",
Expand Down
26 changes: 26 additions & 0 deletions core/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,32 @@ protected function _initConfig()
return $config;
}

/** Display the debug toolbar, if enabled. */
protected function _initZFDebug()
{
$this->bootstrap('config');
$zfDebugPath = BASE_PATH.'/vendor/jokkedk/zfdebug/library';

if (Zend_Registry::get('configGlobal')->debug_toolbar === '1' && file_exists($zfDebugPath)) {
set_include_path(get_include_path().PATH_SEPARATOR.$zfDebugPath);

$options = array(
'plugins' => array('Variables',
'Database' => array('adapter' => Zend_Registry::get('dbAdapter')),
'Exception',
'File' => array('basePath' => BASE_PATH),
'Html',
)
);

$debug = new ZFDebug_Controller_Plugin_Debug($options);

$this->bootstrap('frontController');
$frontController = $this->getResource('frontController');
$frontController->registerPlugin($debug);
}
}

/** set up front */
protected function _initFrontModules()
{
Expand Down
3 changes: 2 additions & 1 deletion core/configs/application.ini
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ logtrace = 0
password.prefix =
; outbound HTTP proxy to be used by PHP (empty for none)
httpproxy =
; show debug toolbar
debug_toolbar = 0

[module]

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


[testing]
; Activate error reporting using Zend
mode.debug = 1
Expand Down

0 comments on commit 35b9045

Please sign in to comment.