summaryrefslogtreecommitdiff
path: root/app/ServiceProvider
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-11-15 12:50:33 -0500
committerFrederic Guillot <fred@kanboard.net>2015-11-15 12:50:33 -0500
commita675271ad71b7713d1b33bdba3c51b2b04813229 (patch)
treee54d8a95e16ca521193b9fd5a5eb071aa2910823 /app/ServiceProvider
parent2fc402f6733573627ad25394d109b9f848ef04f6 (diff)
Rewrite of session management
Diffstat (limited to 'app/ServiceProvider')
-rw-r--r--app/ServiceProvider/ClassProvider.php3
-rw-r--r--app/ServiceProvider/DatabaseProvider.php2
-rw-r--r--app/ServiceProvider/EventDispatcherProvider.php2
-rw-r--r--app/ServiceProvider/LoggingProvider.php2
-rw-r--r--app/ServiceProvider/SessionProvider.php29
5 files changed, 37 insertions, 1 deletions
diff --git a/app/ServiceProvider/ClassProvider.php b/app/ServiceProvider/ClassProvider.php
index 2699de17..9c9bc233 100644
--- a/app/ServiceProvider/ClassProvider.php
+++ b/app/ServiceProvider/ClassProvider.php
@@ -85,7 +85,6 @@ class ClassProvider implements ServiceProviderInterface
'DateParser',
'Helper',
'Lexer',
- 'Session',
'Template',
),
'Core\Http' => array(
@@ -158,5 +157,7 @@ class ClassProvider implements ServiceProviderInterface
$container['pluginLoader'] = new Loader($container);
$container['cspRules'] = array('style-src' => "'self' 'unsafe-inline'", 'img-src' => '* data:');
+
+ return $container;
}
}
diff --git a/app/ServiceProvider/DatabaseProvider.php b/app/ServiceProvider/DatabaseProvider.php
index b2115644..8cede8af 100644
--- a/app/ServiceProvider/DatabaseProvider.php
+++ b/app/ServiceProvider/DatabaseProvider.php
@@ -15,6 +15,8 @@ class DatabaseProvider implements ServiceProviderInterface
$container['db'] = $this->getInstance();
$container['db']->stopwatch = DEBUG;
$container['db']->logQueries = DEBUG;
+
+ return $container;
}
/**
diff --git a/app/ServiceProvider/EventDispatcherProvider.php b/app/ServiceProvider/EventDispatcherProvider.php
index 1711919e..17141fd4 100644
--- a/app/ServiceProvider/EventDispatcherProvider.php
+++ b/app/ServiceProvider/EventDispatcherProvider.php
@@ -32,5 +32,7 @@ class EventDispatcherProvider implements ServiceProviderInterface
// Automatic actions
$container['action']->attachEvents();
+
+ return $container;
}
}
diff --git a/app/ServiceProvider/LoggingProvider.php b/app/ServiceProvider/LoggingProvider.php
index 4344bccc..68c074f0 100644
--- a/app/ServiceProvider/LoggingProvider.php
+++ b/app/ServiceProvider/LoggingProvider.php
@@ -26,5 +26,7 @@ class LoggingProvider implements ServiceProviderInterface
}
$container['logger'] = $logger;
+
+ return $container;
}
}
diff --git a/app/ServiceProvider/SessionProvider.php b/app/ServiceProvider/SessionProvider.php
new file mode 100644
index 00000000..414d9578
--- /dev/null
+++ b/app/ServiceProvider/SessionProvider.php
@@ -0,0 +1,29 @@
+<?php
+
+namespace Kanboard\ServiceProvider;
+
+use Pimple\Container;
+use Pimple\ServiceProviderInterface;
+use Kanboard\Core\Session\SessionManager;
+use Kanboard\Core\Session\SessionStorage;
+use Kanboard\Core\Session\FlashMessage;
+
+class SessionProvider implements ServiceProviderInterface
+{
+ public function register(Container $container)
+ {
+ $container['sessionStorage'] = function() {
+ return new SessionStorage;
+ };
+
+ $container['sessionManager'] = function($c) {
+ return new SessionManager($c);
+ };
+
+ $container['flash'] = function($c) {
+ return new FlashMessage($c);
+ };
+
+ return $container;
+ }
+}