Loading module/Oscar/src/Oscar/Command/OscarActivityImportJsonCommand.php +4 −2 Original line number Diff line number Diff line Loading @@ -129,7 +129,7 @@ class OscarActivityImportJsonCommand extends OscarCommandAbstract return $realpath; } protected function execute(InputInterface $input, OutputInterface $output) protected function execute(InputInterface $input, OutputInterface $output) :int { $this->addOutputStyle($output); Loading Loading @@ -158,7 +158,7 @@ class OscarActivityImportJsonCommand extends OscarCommandAbstract $file = $this->getReadablePath($input->getOption('fichier')); } catch (\Exception $e) { $io->error("Impossible de lire le fichier source : " . $e->getMessage()); return; return self::FAILURE; } $options = [ Loading Loading @@ -223,6 +223,8 @@ class OscarActivityImportJsonCommand extends OscarCommandAbstract $output = new ConnectorRepportToPlainText(); $output->format($repport); return self::SUCCESS; /****/ } } No newline at end of file module/Oscar/src/Oscar/Command/OscarOrganizationsSyncJsonCommand.php +12 −6 Original line number Diff line number Diff line Loading @@ -44,7 +44,7 @@ class OscarOrganizationsSyncJsonCommand extends OscarCommandAbstract ; } protected function execute(InputInterface $input, OutputInterface $output) protected function execute(InputInterface $input, OutputInterface $output) :int { $this->addOutputStyle($output); Loading @@ -68,15 +68,18 @@ class OscarOrganizationsSyncJsonCommand extends OscarCommandAbstract try { $fichier = $input->getArgument('fichier'); if (!$fichier) die("Vous devez spécifier le chemin complet vers le fichier JSON"); if (!$fichier) { $io->error("Vous devez spécifier le chemin complet vers le fichier JSON"); return self::FAILURE; } echo "Synchronisation depuis le fichier $fichier\n"; $io->info("Synchronisation depuis le fichier $fichier"); $sourceJSONFile = new GetJsonDataFromFileStrategy($fichier); try { $datas = $sourceJSONFile->getAll(); } catch (\Exception $e) { die("ERR : Impossible de charger les ogranizations depuis $fichier : " . $e->getMessage()); $io->error($e->getMessage()); return self::FAILURE; } $connector = new ConnectorOrganizationJSON($datas, Loading @@ -88,7 +91,8 @@ class OscarOrganizationsSyncJsonCommand extends OscarCommandAbstract $connectorFormatter->format($repport); } catch (\Exception $e) { die("ERR : " . $e->getMessage()); $io->error($e->getMessage()); return self::FAILURE; } $io->section("Reconstruction de l'index de recherche : "); Loading @@ -102,9 +106,11 @@ class OscarOrganizationsSyncJsonCommand extends OscarCommandAbstract $io->success(sprintf('Index de recherche mis à jour avec %s organisations indexées', count($organizations))); } catch ( \Exception $e ){ $io->error($e->getMessage()); return self::FAILURE; } } else { $io->warning("Pas de reconstruction d'index"); } return self::SUCCESS; } } No newline at end of file module/Oscar/src/Oscar/Command/OscarPersonsSyncJsonCommand.php +8 −4 Original line number Diff line number Diff line Loading @@ -45,7 +45,7 @@ class OscarPersonsSyncJsonCommand extends OscarCommandAbstract ; } protected function execute(InputInterface $input, OutputInterface $output) protected function execute(InputInterface $input, OutputInterface $output) :int { $this->addOutputStyle($output); Loading Loading @@ -77,7 +77,8 @@ class OscarPersonsSyncJsonCommand extends OscarCommandAbstract try { $datas = $sourceJSONFile->getAll(); } catch (\Exception $e) { die("ERR : Impossible de charger les ogranizations depuis $fichier : " . $e->getMessage()); $io->error("Impossible de charger les ogranizations depuis $fichier : " . $e->getMessage()); return self::FAILURE; } $connector = new ConnectorPersonJSON($datas, $entityManager, "json"); Loading @@ -86,7 +87,8 @@ class OscarPersonsSyncJsonCommand extends OscarCommandAbstract $connectorFormatter->format($repport); } catch (\Exception $e) { die("ERR : " . $e->getMessage()); $io->error($e->getMessage()); return self::FAILURE; } $io->section("Reconstruction de l'index de recherche : "); Loading @@ -100,9 +102,11 @@ class OscarPersonsSyncJsonCommand extends OscarCommandAbstract $io->success(sprintf('Index de recherche mis à jour avec %s organisations indexées', count($organizations))); } catch ( \Exception $e ){ $io->error($e->getMessage()); return self::FAILURE; } } else { $io->warning("Pas de reconstruction d'index"); $io->info("Pas de reconstruction d'index"); } return self::SUCCESS; } } No newline at end of file Loading
module/Oscar/src/Oscar/Command/OscarActivityImportJsonCommand.php +4 −2 Original line number Diff line number Diff line Loading @@ -129,7 +129,7 @@ class OscarActivityImportJsonCommand extends OscarCommandAbstract return $realpath; } protected function execute(InputInterface $input, OutputInterface $output) protected function execute(InputInterface $input, OutputInterface $output) :int { $this->addOutputStyle($output); Loading Loading @@ -158,7 +158,7 @@ class OscarActivityImportJsonCommand extends OscarCommandAbstract $file = $this->getReadablePath($input->getOption('fichier')); } catch (\Exception $e) { $io->error("Impossible de lire le fichier source : " . $e->getMessage()); return; return self::FAILURE; } $options = [ Loading Loading @@ -223,6 +223,8 @@ class OscarActivityImportJsonCommand extends OscarCommandAbstract $output = new ConnectorRepportToPlainText(); $output->format($repport); return self::SUCCESS; /****/ } } No newline at end of file
module/Oscar/src/Oscar/Command/OscarOrganizationsSyncJsonCommand.php +12 −6 Original line number Diff line number Diff line Loading @@ -44,7 +44,7 @@ class OscarOrganizationsSyncJsonCommand extends OscarCommandAbstract ; } protected function execute(InputInterface $input, OutputInterface $output) protected function execute(InputInterface $input, OutputInterface $output) :int { $this->addOutputStyle($output); Loading @@ -68,15 +68,18 @@ class OscarOrganizationsSyncJsonCommand extends OscarCommandAbstract try { $fichier = $input->getArgument('fichier'); if (!$fichier) die("Vous devez spécifier le chemin complet vers le fichier JSON"); if (!$fichier) { $io->error("Vous devez spécifier le chemin complet vers le fichier JSON"); return self::FAILURE; } echo "Synchronisation depuis le fichier $fichier\n"; $io->info("Synchronisation depuis le fichier $fichier"); $sourceJSONFile = new GetJsonDataFromFileStrategy($fichier); try { $datas = $sourceJSONFile->getAll(); } catch (\Exception $e) { die("ERR : Impossible de charger les ogranizations depuis $fichier : " . $e->getMessage()); $io->error($e->getMessage()); return self::FAILURE; } $connector = new ConnectorOrganizationJSON($datas, Loading @@ -88,7 +91,8 @@ class OscarOrganizationsSyncJsonCommand extends OscarCommandAbstract $connectorFormatter->format($repport); } catch (\Exception $e) { die("ERR : " . $e->getMessage()); $io->error($e->getMessage()); return self::FAILURE; } $io->section("Reconstruction de l'index de recherche : "); Loading @@ -102,9 +106,11 @@ class OscarOrganizationsSyncJsonCommand extends OscarCommandAbstract $io->success(sprintf('Index de recherche mis à jour avec %s organisations indexées', count($organizations))); } catch ( \Exception $e ){ $io->error($e->getMessage()); return self::FAILURE; } } else { $io->warning("Pas de reconstruction d'index"); } return self::SUCCESS; } } No newline at end of file
module/Oscar/src/Oscar/Command/OscarPersonsSyncJsonCommand.php +8 −4 Original line number Diff line number Diff line Loading @@ -45,7 +45,7 @@ class OscarPersonsSyncJsonCommand extends OscarCommandAbstract ; } protected function execute(InputInterface $input, OutputInterface $output) protected function execute(InputInterface $input, OutputInterface $output) :int { $this->addOutputStyle($output); Loading Loading @@ -77,7 +77,8 @@ class OscarPersonsSyncJsonCommand extends OscarCommandAbstract try { $datas = $sourceJSONFile->getAll(); } catch (\Exception $e) { die("ERR : Impossible de charger les ogranizations depuis $fichier : " . $e->getMessage()); $io->error("Impossible de charger les ogranizations depuis $fichier : " . $e->getMessage()); return self::FAILURE; } $connector = new ConnectorPersonJSON($datas, $entityManager, "json"); Loading @@ -86,7 +87,8 @@ class OscarPersonsSyncJsonCommand extends OscarCommandAbstract $connectorFormatter->format($repport); } catch (\Exception $e) { die("ERR : " . $e->getMessage()); $io->error($e->getMessage()); return self::FAILURE; } $io->section("Reconstruction de l'index de recherche : "); Loading @@ -100,9 +102,11 @@ class OscarPersonsSyncJsonCommand extends OscarCommandAbstract $io->success(sprintf('Index de recherche mis à jour avec %s organisations indexées', count($organizations))); } catch ( \Exception $e ){ $io->error($e->getMessage()); return self::FAILURE; } } else { $io->warning("Pas de reconstruction d'index"); $io->info("Pas de reconstruction d'index"); } return self::SUCCESS; } } No newline at end of file