summaryrefslogtreecommitdiff
path: root/app/ServiceProvider/SessionProvider.php
blob: 0999d5317e7104ca34e0109239b203309541fe18 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?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;

/**
 * Session Provider
 *
 * @package serviceProvider
 * @author  Frederic Guillot
 */
class SessionProvider implements ServiceProviderInterface
{
    /**
     * Register providers
     *
     * @access public
     * @param  \Pimple\Container $container
     * @return \Pimple\Container
     */
    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;
    }
}