diff --git a/core/lib/Thelia/Core/Event/TheliaEvents.php b/core/lib/Thelia/Core/Event/TheliaEvents.php index 97d92e110..1efd6c4d2 100755 --- a/core/lib/Thelia/Core/Event/TheliaEvents.php +++ b/core/lib/Thelia/Core/Event/TheliaEvents.php @@ -33,6 +33,11 @@ namespace Thelia\Core\Event; final class TheliaEvents { + /** + * sent at the beginning + */ + const BOOT = "thelia.boot"; + /** * ACTION event * diff --git a/core/lib/Thelia/Core/Thelia.php b/core/lib/Thelia/Core/Thelia.php index b28b23156..207cced9c 100755 --- a/core/lib/Thelia/Core/Thelia.php +++ b/core/lib/Thelia/Core/Thelia.php @@ -39,6 +39,7 @@ use Symfony\Component\Yaml\Yaml; use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag; use Thelia\Core\Bundle; +use Thelia\Core\Event\TheliaEvents; use Thelia\Log\Tlog; use Thelia\Config\DatabaseConfiguration; use Thelia\Config\DefinePropel; @@ -88,6 +89,16 @@ class Thelia extends Kernel } } + /** + * dispatch an event when application is boot + */ + public function boot() + { + parent::boot(); + + $this->getContainer()->get("event_dispatcher")->dispatch(TheliaEvents::BOOT); + } + /** * * Load some configuration diff --git a/core/lib/Thelia/DataCollector/PropelCollector.php b/core/lib/Thelia/DataCollector/PropelCollector.php index 778db4c1f..97795d7ca 100644 --- a/core/lib/Thelia/DataCollector/PropelCollector.php +++ b/core/lib/Thelia/DataCollector/PropelCollector.php @@ -56,7 +56,7 @@ class PropelCollector extends DataCollector implements Renderable, LoggerInterfa */ function getName() { - // TODO: Implement getName() method. + return "Propel 2"; } public function getWidgets() @@ -73,4 +73,124 @@ class PropelCollector extends DataCollector implements Renderable, LoggerInterfa ) ); } + + /** + * System is unusable. + * + * @param string $message + * @param array $context + * @return null + */ + public function emergency($message, array $context = array()) + { + // TODO: Implement emergency() method. + } + + /** + * Action must be taken immediately. + * + * Example: Entire website down, database unavailable, etc. This should + * trigger the SMS alerts and wake you up. + * + * @param string $message + * @param array $context + * @return null + */ + public function alert($message, array $context = array()) + { + // TODO: Implement alert() method. + } + + /** + * Critical conditions. + * + * Example: Application component unavailable, unexpected exception. + * + * @param string $message + * @param array $context + * @return null + */ + public function critical($message, array $context = array()) + { + // TODO: Implement critical() method. + } + + /** + * Runtime errors that do not require immediate action but should typically + * be logged and monitored. + * + * @param string $message + * @param array $context + * @return null + */ + public function error($message, array $context = array()) + { + // TODO: Implement error() method. + } + + /** + * Exceptional occurrences that are not errors. + * + * Example: Use of deprecated APIs, poor use of an API, undesirable things + * that are not necessarily wrong. + * + * @param string $message + * @param array $context + * @return null + */ + public function warning($message, array $context = array()) + { + // TODO: Implement warning() method. + } + + /** + * Normal but significant events. + * + * @param string $message + * @param array $context + * @return null + */ + public function notice($message, array $context = array()) + { + // TODO: Implement notice() method. + } + + /** + * Interesting events. + * + * Example: User logs in, SQL logs. + * + * @param string $message + * @param array $context + * @return null + */ + public function info($message, array $context = array()) + { + // TODO: Implement info() method. + } + + /** + * Detailed debug information. + * + * @param string $message + * @param array $context + * @return null + */ + public function debug($message, array $context = array()) + { + // TODO: Implement debug() method. + } + + /** + * Logs with an arbitrary level. + * + * @param mixed $level + * @param string $message + * @param array $context + * @return null + */ + public function log($level, $message, array $context = array()) + { + // TODO: Implement log() method. + } } \ No newline at end of file diff --git a/templates/admin/default/admin-layout.tpl b/templates/admin/default/admin-layout.tpl index 8bef5c011..24febd759 100644 --- a/templates/admin/default/admin-layout.tpl +++ b/templates/admin/default/admin-layout.tpl @@ -23,6 +23,8 @@ {/stylesheets} + {debugbar_renderHead} + {block name="after-bootstrap-css"}{/block} {* -- Admin CSS section ------------------------------------------------- *} @@ -221,7 +223,7 @@ {/javascripts} {block name="javascript-initialization"}{/block} - + {debugbar_render} {* Modules scripts are included now *} {module_include location='footer_js'} diff --git a/templates/default/includes/footer.html b/templates/default/includes/footer.html index 03188c367..2f14e2fd8 100755 --- a/templates/default/includes/footer.html +++ b/templates/default/includes/footer.html @@ -13,6 +13,6 @@ }); }); - + {debugbar_render} \ No newline at end of file diff --git a/templates/default/includes/header.html b/templates/default/includes/header.html index 38e78478e..b605ecbb7 100755 --- a/templates/default/includes/header.html +++ b/templates/default/includes/header.html @@ -7,6 +7,7 @@ {stylesheets file='../assets/css/*' filters='less,cssembed'} {/stylesheets} + {debugbar_renderHead}