Commit 5c7f1797 authored by Laurent Lecluse's avatar Laurent Lecluse
Browse files

Migration de laminas_console vers symfony-console

parent e5ee4379
Loading
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
CHANGELOG
=========

6.0.3 (07/11/2024)
------------------

- Migration de laminas/console vers synfony/console


6.0.2 (29/11/2023)
------------------
- [FIX] correction de bug à l'affichage du différentiel avec présence de filtre
+2 −1
Original line number Diff line number Diff line
@@ -9,7 +9,8 @@
    ],
    "require"     : {
        "unicaen/authentification" : "^6.0",
        "unicaen/privilege"      : "^6.0"
        "unicaen/privilege"      : "^6.0",
        "symfony/console": "^4.4|^5.4|^6.0|^7.0"
    },
    "require-dev" : {
        "phpunit/phpunit": "^5.7"
+9 −25
Original line number Diff line number Diff line
@@ -173,33 +173,15 @@ return [
        ],
    ],

    'console' => [
        'router' => [
            'routes' => [
                'sync-job' => [
                    'options' => [
                        'type'     => 'catchall',
                        'route'    => 'UnicaenImport SyncJob <job>',
                        'defaults' => [
                            'controller' => 'Import\Controller\Import',
                            'action'     => 'sync-job',
                        ],
                    ],
                ],
                'maj-vues-fonctions' => [
                    'options' => [
                        'type'     => 'simple',
                        'route'    => 'UnicaenImport MajVuesFonctions',
                        'defaults' => [
                            'controller' => 'Import\Controller\Import',
                            'action'     => 'maj-vues-fonctions-console',
                        ],
                    ],
                ],
            ],

    'laminas-cli' => [
        'commands' => [
            'unicaen-import:sync-job'           => Command\SyncJobCommand::class,
            'unicaen-import:maj-vues-fonctions' => Command\MajVuesFonctionsCommand::class,
        ],
    ],


    'navigation' => [
        'default' => [
            'home' => [
@@ -372,6 +354,8 @@ return [
            Service\TableService::class                     => Service\Factory\TableServiceFactory::class,
            Processus\ImportProcessus::class                => Processus\Factory\ImportProcessusFactory::class,
            ORM\Event\Listeners\EntitySourceInjector::class => ORM\Event\Listeners\Factory\EntitySourceInjectorFactory::class,
            Command\MajVuesFonctionsCommand::class          => Command\MajVuesFonctionsCommandFactory::class,
            Command\SyncJobCommand::class                   => Command\SyncJobCommandFactory::class,
        ],
    ],

+42 −0
Original line number Diff line number Diff line
<?php

namespace UnicaenImport\Command;

use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
use UnicaenImport\Processus\Traits\ImportProcessusAwareTrait;

/**
 * Description of MajVuesFonctionsCommand
 *
 * @author Laurent Lécluse <laurent.lecluse at unicaen.fr>
 */
class MajVuesFonctionsCommand extends Command
{
    use ImportProcessusAwareTrait;

    protected function configure(): void
    {
        $this->setDescription('Mise à jour des vues différentielles & des procédures de MAJ');
    }



    protected function execute(InputInterface $input, OutputInterface $output): int
    {
        $io  = new SymfonyStyle($input, $output);

        $io->title($this->getDescription());

        try {
            $this->getProcessusImport()->updateViewsAndPackages();
            $io->success('Mise à jour des vues différentielles et du paquetage d\'import terminés');
        } catch (\Exception $e) {
            echo 'Une erreur a été rencontrée.';
        }

        return Command::SUCCESS;
    }
}
 No newline at end of file
+32 −0
Original line number Diff line number Diff line
<?php

namespace UnicaenImport\Command;

use Psr\Container\ContainerInterface;
use UnicaenImport\Processus\ImportProcessus;


/**
 * Description of MajVuesFonctionsCommandFactory
 *
 * @author Laurent Lécluse <laurent.lecluse at unicaen.fr>
 */
class MajVuesFonctionsCommandFactory
{

    /**
     * @param ContainerInterface $container
     * @param string             $requestedName
     * @param array|null         $options
     *
     * @return MajVuesFonctionsCommand
     */
    public function __invoke(ContainerInterface $container, $requestedName, $options = null): MajVuesFonctionsCommand
    {
        $command = new MajVuesFonctionsCommand;

        $command->setProcessusImport($container->get(ImportProcessus::class));

        return $command;
    }
}
 No newline at end of file
Loading