diff --git a/composer.json b/composer.json index 09aa606b5..2fa2e3eb1 100755 --- a/composer.json +++ b/composer.json @@ -41,7 +41,8 @@ }, "require-dev" : { "phpunit/phpunit": "3.7.*", - "fzaninotto/faker": "dev-master" + "fzaninotto/faker": "dev-master", + "maximebf/debugbar": "1.*" }, "minimum-stability": "stable", "config" : { diff --git a/composer.lock b/composer.lock index a54fe3024..116b0700a 100755 --- a/composer.lock +++ b/composer.lock @@ -3,7 +3,7 @@ "This file locks the dependencies of your project to a known state", "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file" ], - "hash": "db69990b239a4056558bfd694115d01b", + "hash": "4add17e0d3f6275417122481707e9f52", "packages": [ { "name": "ezyang/htmlpurifier", @@ -1662,6 +1662,55 @@ ], "time": "2013-08-29 19:11:59" }, + { + "name": "maximebf/debugbar", + "version": "1.5.1", + "source": { + "type": "git", + "url": "https://github.com/maximebf/php-debugbar.git", + "reference": "37dccc40da52bf9f85571c30cf302da696db0d05" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/maximebf/php-debugbar/zipball/37dccc40da52bf9f85571c30cf302da696db0d05", + "reference": "37dccc40da52bf9f85571c30cf302da696db0d05", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "psr/log": "~1.0" + }, + "require-dev": { + "php": ">=5.3.0" + }, + "suggest": { + "kriswallsmith/assetic": "The best way to manage assets", + "monolog/monolog": "Log using Monolog" + }, + "type": "library", + "autoload": { + "psr-0": { + "DebugBar": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Maxime Bouroumeau-Fuseau", + "email": "maxime.bouroumeau@gmail.com", + "homepage": "http://maximebf.com" + } + ], + "description": "Debug bar in the browser for php application", + "homepage": "https://github.com/maximebf/php-debugbar", + "keywords": [ + "debug" + ], + "time": "2013-08-17 02:02:49" + }, { "name": "phpunit/php-code-coverage", "version": "1.2.12", diff --git a/core/lib/Thelia/DataCollector/PropelCollector.php b/core/lib/Thelia/DataCollector/PropelCollector.php new file mode 100644 index 000000000..778db4c1f --- /dev/null +++ b/core/lib/Thelia/DataCollector/PropelCollector.php @@ -0,0 +1,76 @@ +. */ +/* */ +/*************************************************************************************/ +namespace Thelia\DataCollector; + +use DebugBar\DataCollector\DataCollector; +use DebugBar\DataCollector\Renderable; +use Propel\Runtime\Propel; +use Psr\Log\LoggerInterface; + +/** + * Class PropelCollector + * @author Manuel Raynaud + */ +class PropelCollector extends DataCollector implements Renderable, LoggerInterface { + + public function __construct() + { + $serviceContainer = Propel::getServiceContainer(); + $serviceContainer->setLogger('debugBarLogger', $this); + } + + /** + * Called by the DebugBar when data needs to be collected + * + * @return array Collected data + */ + function collect() + { + // TODO: Implement collect() method. + } + + /** + * Returns the unique name of the collector + * + * @return string + */ + function getName() + { + // TODO: Implement getName() method. + } + + public function getWidgets() + { + return array( + "propel" => array( + "widget" => "PhpDebugBar.Widgets.SQLQueriesWidget", + "map" => "propel 2", + "default" => "[]" + ), + "propel:badge" => array( + "map" => "propel.nb_statements", + "default" => 0 + ) + ); + } +} \ No newline at end of file