summaryrefslogtreecommitdiff
path: root/app/Subscriber/BootstrapSubscriber.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Subscriber/BootstrapSubscriber.php')
-rw-r--r--app/Subscriber/BootstrapSubscriber.php29
1 files changed, 24 insertions, 5 deletions
diff --git a/app/Subscriber/BootstrapSubscriber.php b/app/Subscriber/BootstrapSubscriber.php
index 25b919f7..ef0215f3 100644
--- a/app/Subscriber/BootstrapSubscriber.php
+++ b/app/Subscriber/BootstrapSubscriber.php
@@ -4,20 +4,39 @@ namespace Kanboard\Subscriber;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
-class BootstrapSubscriber extends \Kanboard\Core\Base implements EventSubscriberInterface
+class BootstrapSubscriber extends BaseSubscriber implements EventSubscriberInterface
{
public static function getSubscribedEvents()
{
return array(
- 'session.bootstrap' => array('setup', 0),
- 'api.bootstrap' => array('setup', 0),
- 'console.bootstrap' => array('setup', 0),
+ 'app.bootstrap' => 'execute',
);
}
- public function setup()
+ public function execute()
{
+ $this->logger->debug('Subscriber executed: '.__METHOD__);
$this->config->setupTranslations();
$this->config->setupTimezone();
+ $this->actionManager->attachEvents();
+
+ if ($this->userSession->isLogged()) {
+ $this->sessionStorage->hasSubtaskInProgress = $this->subtask->hasSubtaskInProgress($this->userSession->getId());
+ }
+ }
+
+ public function __destruct()
+ {
+ if (DEBUG) {
+ foreach ($this->db->getLogMessages() as $message) {
+ $this->logger->debug($message);
+ }
+
+ $this->logger->debug('SQL_QUERIES={nb}', array('nb' => $this->container['db']->nbQueries));
+ $this->logger->debug('RENDERING={time}', array('time' => microtime(true) - $this->request->getStartTime()));
+ $this->logger->debug('MEMORY='.$this->helper->text->bytes(memory_get_usage()));
+ $this->logger->debug('URI='.$this->request->getUri());
+ $this->logger->debug('###############################################');
+ }
}
}