Module.php 2.21 KB
Newer Older
Bertrand Gauthier's avatar
Bertrand Gauthier committed
1
2
3
4
<?php

namespace UnicaenAuth;

Bertrand Gauthier's avatar
Bertrand Gauthier committed
5
use Zend\EventManager\EventInterface;
Bertrand Gauthier's avatar
Bertrand Gauthier committed
6
7
8
use Zend\ModuleManager\Feature\AutoloaderProviderInterface;
use Zend\ModuleManager\Feature\ConfigProviderInterface;
use Zend\ModuleManager\Feature\ServiceProviderInterface;
Bertrand Gauthier's avatar
Bertrand Gauthier committed
9
10
use ZfcUser\Form\Login;
use ZfcUser\Form\LoginFilter;
Bertrand Gauthier's avatar
Bertrand Gauthier committed
11
12
13

/**
 * Point d'entrée du module d'authentification Unicaen.
14
 *
Bertrand Gauthier's avatar
Bertrand Gauthier committed
15
16
 * @author Bertrand GAUTHIER <bertrand.gauthier@unicaen.fr>
 */
17
class Module implements AutoloaderProviderInterface, ConfigProviderInterface, ServiceProviderInterface
Bertrand Gauthier's avatar
Bertrand Gauthier committed
18
{
Bertrand Gauthier's avatar
Bertrand Gauthier committed
19
    /**
Bertrand Gauthier's avatar
Bertrand Gauthier committed
20
21
22
23
24
25
26
27
28
29
30
31
32
33
     * @return array
     * @see ConfigProviderInterface
     */
    public function getConfig()
    {
        return include __DIR__ . '/config/module.config.php';
    }

    /**
     * @return array
     * @see AutoloaderProviderInterface
     */
    public function getAutoloaderConfig()
    {
34
35
36
        return [
            'Zend\Loader\StandardAutoloader' => [
                'namespaces' => [
Bertrand Gauthier's avatar
Bertrand Gauthier committed
37
                    __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
38
39
40
                ],
            ],
        ];
Bertrand Gauthier's avatar
Bertrand Gauthier committed
41
42
43
44
45
    }

    /**
     * This method is called once the MVC bootstrapping is complete,
     * after the "loadModule.post" event, once $application->bootstrap() is called.
46
     *
Bertrand Gauthier's avatar
Bertrand Gauthier committed
47
     * @param EventInterface $e
48
     *
Bertrand Gauthier's avatar
Bertrand Gauthier committed
49
50
     * @see BootstrapListenerInterface
     */
Bertrand Gauthier's avatar
Bertrand Gauthier committed
51
    public function onBootstrap(EventInterface $e)
Bertrand Gauthier's avatar
Bertrand Gauthier committed
52
    {
53

Bertrand Gauthier's avatar
Bertrand Gauthier committed
54
    }
55

Bertrand Gauthier's avatar
Bertrand Gauthier committed
56
57
58
59
60
61
    /**
     * @return array
     * @see ServiceProviderInterface
     */
    public function getServiceConfig()
    {
62
        return [
63
64
65
66
67
68
69
            //========== repris du module zf-commons/zfc-user-doctrine-orm abandonné =========
            'aliases' => array(
                'zfcuser_doctrine_em' => 'Doctrine\ORM\EntityManager',
            ),
            //===========================================


70
            'factories' => [
71
72
73
74
75
76
77
                //========== repris du module zf-commons/zfc-user-doctrine-orm abandonné =========
                'zfcuser_module_options' => function ($sm) {
                    $config = $sm->get('Configuration');
                    return new Options\ModuleOptions(isset($config['zfcuser']) ? $config['zfcuser'] : array());
                },
                //===========================================

78
79
            ],
        ];
80
    }
81
}