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

Retrait des routes consoles

parent ab3a2a0a
Loading
Loading
Loading
Loading
Loading
+16 −18
Original line number Diff line number Diff line
@@ -2,16 +2,22 @@

namespace UnicaenIndicateur;

use Laminas\Config\Config;
use Laminas\Config\Factory as ConfigFactory;
use Laminas\Mvc\ModuleRouteListener;
use Laminas\Mvc\MvcEvent;
use Laminas\Stdlib\ArrayUtils;
use Laminas\Stdlib\Glob;
use Unicaen\Console\Console;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;

class Module
{
    public function onBootstrap(MvcEvent $e)
    /**
     * @throws ContainerExceptionInterface
     * @throws NotFoundExceptionInterface
     */
    public function onBootstrap(MvcEvent $e): void
    {
        $e->getApplication()->getServiceManager()->get('translator');
        $eventManager        = $e->getApplication()->getEventManager();
@@ -20,7 +26,7 @@ class Module

    }

    public function getConfig()
    public function getConfig(): array|Config
    {
        $configInit = [
            __DIR__ . '/config/module.config.php'
@@ -34,23 +40,15 @@ class Module
    }


    public function getAutoloaderConfig()
    public function getAutoloaderConfig(): array
    {
        return array(
            'Laminas\Loader\StandardAutoloader' => array(
                'namespaces' => array(
        return [
            'Laminas\Loader\StandardAutoloader' => [
                'namespaces' => [
                    __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
                ),
            ),
        );
                ],
            ],
        ];
    }

//    public function getConsoleUsage(Console $console)
//    {
//        return [
//            'indicateur-refresh'  => "Rafraichir la liste des indicateurs",
//
//            'indicateur-notifier' => "Notifier les personnes abonnées à des indicateurs avec les données du dernier rafraichissement",
//        ];
//    }
}
+5 −5
Original line number Diff line number Diff line
@@ -8,11 +8,11 @@
        }
    ],
    "require": {
        "unicaen/app": "^4|^5|^6",
        "unicaen/utilisateur": "^4|^5|^6",
        "unicaen/privilege": "^4|^5|^6",
        "unicaen/mail": "^5|^6|^7",
        "unicaen/console": "^6"
        "laminas/laminas-cli": "*",
        "unicaen/app": ">=6.2",
        "unicaen/utilisateur": ">=6.2",
        "unicaen/privilege": ">=6.2",
        "unicaen/mail": ">7"
    },
    "autoload": {
        "psr-0": [],
+15 −33
Original line number Diff line number Diff line
<?php

use Unicaen\Console\Router\Simple;
use Laminas\Router\Http\Literal;
use Laminas\Router\Http\Segment;
use UnicaenIndicateur\Controller\AbonnementController;
use UnicaenIndicateur\Controller\AbonnementControllerFactory;
use UnicaenIndicateur\Provider\Privilege\AbonnementPrivileges;
@@ -8,9 +9,6 @@ use UnicaenIndicateur\Service\Abonnement\AbonnementService;
use UnicaenIndicateur\Service\Abonnement\AbonnementServiceFactory;
use UnicaenPrivilege\Guard\PrivilegeController;

use Laminas\Router\Http\Literal;
use Laminas\Router\Http\Segment;

return [
    'bjyauthorize' => [
        'guards' => [
@@ -54,7 +52,7 @@ return [
                        'options' => [
                            'route' => '/souscrire/:indicateur',
                            'defaults' => [
                                'controller' => AbonnementController::class,
                                /** @see AbonnementController::souscrireAction() */
                                'action' => 'souscrire'
                            ],
                        ],
@@ -65,7 +63,7 @@ return [
                        'options' => [
                            'route' => '/resilier/:indicateur',
                            'defaults' => [
                                'controller' => AbonnementController::class,
                                /** @see AbonnementController::resilierAction() */
                                'action' => 'resilier'
                            ],
                        ],
@@ -76,7 +74,7 @@ return [
                        'options' => [
                            'route' => '/notifier',
                            'defaults' => [
                                'controller' => AbonnementController::class,
                                /** @see AbonnementController::notifierAction() */
                                'action' => 'notifier'
                            ],
                        ],
@@ -87,22 +85,6 @@ return [
        ],
    ],

    'console' => [
        'router' => [
            'routes' => [
                'indicateur-notifier' => [
                    'type' => Simple::class,
                    'options' => [
                        'route' => 'indicateur-notifier',
                        'defaults' => [
                            'controller' => AbonnementController::class,
                            'action' => 'notifier-console'
                        ],
                    ],
                ],
            ],
        ],
    ],
    'service_manager' => [
        'factories' => [
            AbonnementService::class => AbonnementServiceFactory::class,
+54 −0
Original line number Diff line number Diff line
<?php


use UnicaenIndicateur\Command\NotifyIndicateurCommand;
use UnicaenIndicateur\Command\NotifyIndicateurCommandFactory;
use UnicaenIndicateur\Command\NotifyIndicateursCommand;
use UnicaenIndicateur\Command\NotifyIndicateursCommandFactory;
use UnicaenIndicateur\Command\RefreshIndicateurCommand;
use UnicaenIndicateur\Command\RefreshIndicateurCommandFactory;
use UnicaenIndicateur\Command\RefreshIndicateursCommand;
use UnicaenIndicateur\Command\RefreshIndicateursCommandFactory;

return [
    'bjyauthorize' => [
        'guards' => [
        ],
    ],

    'laminas-cli' => [
        'commands' => [
            'notify-indicateur' => NotifyIndicateurCommand::class,
            'notify-indicateurs' => NotifyIndicateursCommand::class,
            'refresh-indicateur' => RefreshIndicateurCommand::class,
            'refresh-indicateurs' => RefreshIndicateursCommand::class,
        ],
    ],

    'controllers' => [
        'factories' => [
        ],
    ],
    'service_manager' => [
        'factories' => [
            NotifyIndicateurCommand::class => NotifyIndicateurCommandFactory::class,
            NotifyIndicateursCommand::class => NotifyIndicateursCommandFactory::class,
            RefreshIndicateurCommand::class => RefreshIndicateurCommandFactory::class,
            RefreshIndicateursCommand::class => RefreshIndicateursCommandFactory::class,
        ],
    ],

    'form_elements' => [
        'factories' => [
        ],
    ],
    'hydrators' => [
        'factories' => [
        ],
    ],
    'view_helpers' => [
        'invokables' => [
        ],
    ],
];
+12 −36
Original line number Diff line number Diff line
<?php

use UnicaenIndicateur\Controller\IndicateurConsoleController;
use UnicaenIndicateur\Controller\IndicateurConsoleControllerFactory;
use UnicaenIndicateur\Controller\IndicateurController;
use UnicaenIndicateur\Controller\IndicateurControllerFactory;
use UnicaenIndicateur\Form\Indicateur\IndicateurForm;
@@ -14,7 +12,6 @@ use UnicaenIndicateur\Service\Indicateur\IndicateurServiceFactory;
use UnicaenIndicateur\View\Helper\DefaultItemViewHelper;
use UnicaenIndicateur\View\Helper\IndicateurViewHelperFactory;
use UnicaenPrivilege\Guard\PrivilegeController;
use Unicaen\Console\Router\Simple;
use Laminas\Router\Http\Literal;
use Laminas\Router\Http\Segment;

@@ -62,15 +59,7 @@ return [
                        IndicateurPrivileges::DETRUIRE_INDICATEUR,
                    ],
                ],
                [
                    'controller' => IndicateurConsoleController::class,
                    'action' => [
                        'rafraichir-console',
            ],
                    'roles' => [],
                ],
            ],

        ],
    ],

@@ -81,6 +70,7 @@ return [
                'options' => [
                    'route'    => '/indicateurs',
                    'defaults' => [
                        /** @see IndicateurController::indexAction() */
                        'controller' => IndicateurController::class,
                        'action'     => 'index',
                    ],
@@ -91,6 +81,10 @@ return [
                'type'  => Literal::class,
                'options' => [
                    'route'    => '/indicateur',
                    'defaults' => [
                        /** @see IndicateurController::indexAction() */
                        'controller' => IndicateurController::class,
                    ],
                ],
                'may_terminate' => false,
                'child_routes' => [
@@ -99,7 +93,7 @@ return [
                        'options' => [
                            'route'    => '/afficher/:indicateur',
                            'defaults' => [
                                'controller' => IndicateurController::class,
                                /** @see IndicateurController::afficherAction() */
                                'action'     => 'afficher',
                            ],
                        ],
@@ -110,7 +104,7 @@ return [
                        'options' => [
                            'route'    => '/rafraichir/:indicateur',
                            'defaults' => [
                                'controller' => IndicateurController::class,
                                /** @see IndicateurController::rafraichirAction() */
                                'action'     => 'rafraichir',
                            ],
                        ],
@@ -121,7 +115,7 @@ return [
                        'options' => [
                            'route'    => '/regenerer/:indicateur',
                            'defaults' => [
                                'controller' => IndicateurController::class,
                                /** @see IndicateurController::regenererAction() */
                                'action'     => 'regenerer',
                            ],
                        ],
@@ -132,7 +126,7 @@ return [
                        'options' => [
                            'route'    => '/creer',
                            'defaults' => [
                                'controller' => IndicateurController::class,
                                /** @see IndicateurController::creerAction() */
                                'action'     => 'creer',
                            ],
                        ],
@@ -143,7 +137,7 @@ return [
                        'options' => [
                            'route'    => '/modifier/:indicateur',
                            'defaults' => [
                                'controller' => IndicateurController::class,
                                /** @see IndicateurController::modifierAction() */
                                'action'     => 'modifier',
                            ],
                        ],
@@ -154,7 +148,7 @@ return [
                        'options' => [
                            'route'    => '/detruire/:indicateur',
                            'defaults' => [
                                'controller' => IndicateurController::class,
                                /** @see IndicateurController::detruireAction() */
                                'action'     => 'detruire',
                            ],
                        ],
@@ -165,7 +159,7 @@ return [
                        'options' => [
                            'route'    => '/exporter/:indicateur',
                            'defaults' => [
                                'controller' => IndicateurController::class,
                                /** @see IndicateurController::exporterAction() */
                                'action'     => 'exporter',
                            ],
                        ],
@@ -176,23 +170,6 @@ return [
        ],
    ],

    'console' => [
        'router' => [
            'routes' => [
                'indicateur-refresh' => [
                    'type' => Simple::class,
                    'options' => [
                        'route' => 'indicateur-refresh',
                        'defaults' => [
                            'controller' => IndicateurConsoleController::class,
                            'action' => 'rafraichir-console'
                        ],
                    ],
                ],
            ],
        ],
    ],

    'service_manager' => [
        'factories' => [
            IndicateurService::class => IndicateurServiceFactory::class,
@@ -201,7 +178,6 @@ return [
    'controllers'     => [
        'factories' => [
            IndicateurController::class => IndicateurControllerFactory::class,
            IndicateurConsoleController::class => IndicateurConsoleControllerFactory::class,
        ],
    ],
    'form_elements' => [
Loading