Commit ca315b3f authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Merge branch 'ModuleFichier' into development

parents 7f65d48d 4afdfa13
Loading
Loading
Loading
Loading
+1
Changes for config/application.config.php: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@ $modules = [
    'BjyAuthorize', 'AssetManager',
    'UnicaenApp', 'UnicaenAuth', 'UnicaenLdap',
    'Autoform',
    'Fichier',
    'Mailing',
    'Octopus',
    'Utilisateur',
+x+52
Changes for module/Fichier/Module.php: 52 added lines, 0 removed lines.
Original line number Diff line number Diff line
<?php

namespace Fichier;

use Zend\Mvc\ModuleRouteListener;
use Zend\Mvc\MvcEvent;
use Zend\Stdlib\ArrayUtils;
use Zend\Stdlib\Glob;
use Zend\Config\Factory as ConfigFactory;

class Module
{
    public function onBootstrap(MvcEvent $e)
    {
        $eventManager        = $e->getApplication()->getEventManager();
        $moduleRouteListener = new ModuleRouteListener();
        $moduleRouteListener->attach($eventManager);

        $eventManager->getSharedManager()->attach('Zend\Mvc\Controller\AbstractActionController', 'dispatch',
            function (MvcEvent $e) {
                $request = $e->getRequest();
                if ($request->isXmlHttpRequest()) {
                    $e->getTarget()->layout('layout/ajax.phtml');
                }
            }
        );
    }

    public function getConfig()
    {
        $configInit = [
            __DIR__ . '/config/module.config.php'
        ];
        $configFiles = ArrayUtils::merge(
            $configInit,
            Glob::glob(__DIR__ . '/config/merged/{,*.}{config}.php', Glob::GLOB_BRACE)
        );

        return ConfigFactory::fromFiles($configFiles);
    }

    public function getAutoloaderConfig()
    {
        return array(
            'Zend\Loader\StandardAutoloader' => array(
                'namespaces' => array(
                    __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
                ),
            ),
        );
    }
}
+120
Changes for module/Fichier/config/merged/fichier.config.php: 120 added lines, 0 removed lines.
Original line number Diff line number Diff line
<?php

namespace Application;

use Autoform\Provider\Privilege\IndexPrivileges;
use Fichier\Controller\Fichier\FichierController;
use Fichier\Controller\Fichier\FichierControllerFactory;
use Fichier\Form\Upload\UploadForm;
use Fichier\Form\Upload\UploadFormFactory;
use Fichier\Form\Upload\UploadHydrator;
use Fichier\Service\Fichier\FichierService;
use Fichier\Service\Fichier\FichierServiceFactory;
use Fichier\Service\Nature\NatureService;
use Fichier\Service\Nature\NatureServiceFactory;
use UnicaenAuth\Guard\PrivilegeController;
use Zend\Mvc\Router\Http\Literal;
use Zend\Mvc\Router\Http\Segment;

return [
    'bjyauthorize' => [
        'guards' => [
            PrivilegeController::class => [
                [
                    'controller' => FichierController::class,
                    'action' => [
                        'upload',
                        'download',
                        'delete',
                    ],
                    'roles' => [
                        'Administrateur technique'
                    ],
                ],
            ],
        ],
    ],

    'router'          => [
        'routes' => [
            'fichier' => [
                'type' => Literal::class,
                'options' => [
                    'route'    => '/fichier',
                ],
                'child_routes' => [
                    'upload' => [
                        'type' => Literal::class,
                        'may_terminate' => true,
                        'options' => [
                            'route'    => '/upload',
                            'default' => [
                                'controller' => FichierController::class,
                                'action' => 'upload',
                            ],
                        ],
                        'child_routes' => [

                        ],
                    ],
                ],
            ],
            'upload-fichier' => [
                'type'          => Literal::class,
                'may_terminate' => true,
                'options' => [
                    'route'    => '/upload-fichier',
                    'defaults' => [
                        'controller' => FichierController::class,
                        'action'     => 'upload',
                    ],
                ],
            ],
            'download-fichier' => [
                'type'          => Segment::class,
                'may_terminate' => true,
                'options' => [
                    'route'    => '/download-fichier/:fichier',
                    'defaults' => [
                        'controller' => FichierController::class,
                        'action'     => 'download',
                    ],
                ],
            ],
            'delete-fichier' => [
                'type'          => Segment::class,
                'may_terminate' => true,
                'options' => [
                    'route'    => '/delete-fichier/:fichier',
                    'defaults' => [
                        'controller' => FichierController::class,
                        'action'     => 'delete',
                    ],
                ],
            ],
        ],
    ],

    'service_manager' => [
        'factories' => [
            FichierService::class => FichierServiceFactory::class,
            NatureService::class => NatureServiceFactory::class,
        ],
    ],
    'controllers'     => [
        'factories' => [
            FichierController::class => FichierControllerFactory::class,
        ],
    ],
    'form_elements' => [
        'factories' => [
            UploadForm::class => UploadFormFactory::class,
        ],
    ],
    'hydrators' => [
        'invokables' => [
            UploadHydrator::class => UploadHydrator::class,
        ],
    ]

];
 No newline at end of file
+61
Changes for module/Fichier/config/merged/index.config.php: 61 added lines, 0 removed lines.
Original line number Diff line number Diff line
<?php

namespace Application;

use Fichier\Controller\Index\IndexController;
use Fichier\Controller\Index\IndexControllerFactory;
use UnicaenAuth\Guard\PrivilegeController;
use Utilisateur\Entity\Db\Role;
use Zend\Mvc\Router\Http\Literal;
use Zend\Mvc\Router\Http\Segment;

return [
    'bjyauthorize' => [
        'guards' => [
            PrivilegeController::class => [
                [
                    'controller' => IndexController::class,
                    'action' => [
                        'index',
                    ],
                    'roles' => [
                        'Administrateur technique',
                    ],
                ],
            ],
        ],
    ],

    'router'          => [
        'routes' => [
            'index-fichier' => [
                'type'          => Literal::class,
                'may_terminate' => true,
                'options' => [
                    'route'    => '/index-fichier',
                    'defaults' => [
                        'controller' => IndexController::class,
                        'action'     => 'index',
                    ],
                ],
            ],

        ],
    ],

    'service_manager' => [
        'factories' => [],
    ],
    'controllers'     => [
        'factories' => [
            IndexController::class => IndexControllerFactory::class,
        ],
    ],
    'form_elements' => [
        'factories' => [],
    ],
    'hydrators' => [
        'factories' => [],
    ]

];
 No newline at end of file
+62
Changes for module/Fichier/config/module.config.php: 62 added lines, 0 removed lines.
Original line number Diff line number Diff line
<?php

use Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain;
use Doctrine\ORM\Mapping\Driver\XmlDriver;
use UnicaenAuth\Guard\PrivilegeController;

return array(
    'bjyauthorize'    => [
        'guards' => [
            PrivilegeController::class => [],
        ],
    ],
    'doctrine' => [
        'driver' => [
            'orm_default' => [
                'class' => MappingDriverChain::class,
                'drivers' => [
                    'Fichier\Entity\Db' => 'orm_default_xml_driver',
                ],
            ],
            'orm_default_xml_driver' => [
                'class' => XmlDriver::class,
                'cache' => 'apc',
                'paths' => [
                    __DIR__ . '/../src/Fichier/Entity/Db/Mapping',
                ],
            ],
        ],
        'cache' => [
            'apc' => [
                'namespace' => 'PREECOG__' . __NAMESPACE__,
            ],
        ],
    ],

    'router' => [
        'routes' => [
        ],
    ],

    'form_elements' => [
        'factories' => [
        ],
    ],
    'hydrators' => [
        'invokables' => [
        ],
    ],
    'controllers' => [
        'factories' => [
        ],
    ],
    'view_helpers' => [
        'invokables' => [
        ],
    ],
    'view_manager' => [
        'template_path_stack' => [
            __DIR__ . '/../view',
        ],
    ],
);
Loading