Loading Module.php +6 −6 Original line number Diff line number Diff line Loading @@ -39,16 +39,16 @@ class Module implements ConsoleUsageProviderInterface public function getConsoleUsage(AdapterInterface $console) { return [ 'run import --name=' => 'Lance un import par son nom (name)', ['--name', "Nom unique de l'import (clé 'name')"], 'run import [--name=<name>]' => 'Lance un import par son nom', ['<name>', "Nom unique de l'import (clé de config 'name')"], 'run import --all' => 'Lance tous les imports', 'run import' => 'Lance tous les imports', [], 'run synchro --name=' => 'Lance une synchronisation par son nom (name)', ['--name', "Nom unique de la synchronisation (clé 'name')"], 'run synchro [--name=<name>]' => 'Lance une synchronisation par son nom', ['<name>', "Nom unique de la synchronisation (clé de config 'name')"], 'run synchro --all' => 'Lance toutes les synchronisations', 'run synchro' => 'Lance toutes les synchronisations', [], ]; } Loading config/module.config.php +2 −2 Original line number Diff line number Diff line Loading @@ -83,7 +83,7 @@ return [ 'execute_imports' => [ 'type' => 'simple', 'options' => [ 'route' => 'run import [--all|-a] [--name=]', 'route' => 'run import [--name=]', 'defaults' => [ 'controller' => 'UnicaenDbImport\Controller\Console', 'action' => 'runImport', Loading @@ -93,7 +93,7 @@ return [ 'execute_synchro' => [ 'type' => 'simple', 'options' => [ 'route' => 'run synchro [--all|-a] [--name=]', 'route' => 'run synchro [--name=]', 'defaults' => [ 'controller' => 'UnicaenDbImport\Controller\Console', 'action' => 'runSynchro', Loading src/UnicaenDbImport/Controller/ConsoleController.php +2 −24 Original line number Diff line number Diff line Loading @@ -135,25 +135,14 @@ class ConsoleController extends AbstractConsoleController { /** @var Request $request */ $request = $this->getRequest(); //Passage de code à probablement concaténer en un (redonant au moins 3 fois) $all = $request->getParam('all') || $request->getParam('a'); $name = $request->getParam('name'); if ($all && $name !== null) { $this->getConsole()->writeLine("Les paramètres 'all' et 'name' sont antinomiques", ColorInterface::RED); } if (!$all && $name === null) { $all = TRUE; } $this->getConsole()->writeLine(); $this->getConsole()->writeLine("######################## IMPORTS ########################", ColorInterface::BLUE); $this->getConsole()->writeLine(); try { if ($all) { if ($name === null) { $imports = $this->importService->getImports(); } else { try { Loading Loading @@ -183,25 +172,14 @@ class ConsoleController extends AbstractConsoleController { /** @var Request $request */ $request = $this->getRequest(); //Passage de code à probablement concaténer en un (redonant au moins 3 fois) $all = $request->getParam('all') || $request->getParam('a'); $name = $request->getParam('name'); if ($all && $name !== null) { $this->getConsole()->writeLine("Les paramètres 'all' et 'name' sont antinomiques", ColorInterface::RED); } if (!$all && $name === null) { $all = TRUE; } $this->getConsole()->writeLine(); $this->getConsole()->writeLine("######################## SYNCHROS ########################", ColorInterface::BLUE); $this->getConsole()->writeLine(); try { if ($all) { if ($name === null) { $synchros = $this->synchroService->getSynchros(); } else { try { Loading Loading
Module.php +6 −6 Original line number Diff line number Diff line Loading @@ -39,16 +39,16 @@ class Module implements ConsoleUsageProviderInterface public function getConsoleUsage(AdapterInterface $console) { return [ 'run import --name=' => 'Lance un import par son nom (name)', ['--name', "Nom unique de l'import (clé 'name')"], 'run import [--name=<name>]' => 'Lance un import par son nom', ['<name>', "Nom unique de l'import (clé de config 'name')"], 'run import --all' => 'Lance tous les imports', 'run import' => 'Lance tous les imports', [], 'run synchro --name=' => 'Lance une synchronisation par son nom (name)', ['--name', "Nom unique de la synchronisation (clé 'name')"], 'run synchro [--name=<name>]' => 'Lance une synchronisation par son nom', ['<name>', "Nom unique de la synchronisation (clé de config 'name')"], 'run synchro --all' => 'Lance toutes les synchronisations', 'run synchro' => 'Lance toutes les synchronisations', [], ]; } Loading
config/module.config.php +2 −2 Original line number Diff line number Diff line Loading @@ -83,7 +83,7 @@ return [ 'execute_imports' => [ 'type' => 'simple', 'options' => [ 'route' => 'run import [--all|-a] [--name=]', 'route' => 'run import [--name=]', 'defaults' => [ 'controller' => 'UnicaenDbImport\Controller\Console', 'action' => 'runImport', Loading @@ -93,7 +93,7 @@ return [ 'execute_synchro' => [ 'type' => 'simple', 'options' => [ 'route' => 'run synchro [--all|-a] [--name=]', 'route' => 'run synchro [--name=]', 'defaults' => [ 'controller' => 'UnicaenDbImport\Controller\Console', 'action' => 'runSynchro', Loading
src/UnicaenDbImport/Controller/ConsoleController.php +2 −24 Original line number Diff line number Diff line Loading @@ -135,25 +135,14 @@ class ConsoleController extends AbstractConsoleController { /** @var Request $request */ $request = $this->getRequest(); //Passage de code à probablement concaténer en un (redonant au moins 3 fois) $all = $request->getParam('all') || $request->getParam('a'); $name = $request->getParam('name'); if ($all && $name !== null) { $this->getConsole()->writeLine("Les paramètres 'all' et 'name' sont antinomiques", ColorInterface::RED); } if (!$all && $name === null) { $all = TRUE; } $this->getConsole()->writeLine(); $this->getConsole()->writeLine("######################## IMPORTS ########################", ColorInterface::BLUE); $this->getConsole()->writeLine(); try { if ($all) { if ($name === null) { $imports = $this->importService->getImports(); } else { try { Loading Loading @@ -183,25 +172,14 @@ class ConsoleController extends AbstractConsoleController { /** @var Request $request */ $request = $this->getRequest(); //Passage de code à probablement concaténer en un (redonant au moins 3 fois) $all = $request->getParam('all') || $request->getParam('a'); $name = $request->getParam('name'); if ($all && $name !== null) { $this->getConsole()->writeLine("Les paramètres 'all' et 'name' sont antinomiques", ColorInterface::RED); } if (!$all && $name === null) { $all = TRUE; } $this->getConsole()->writeLine(); $this->getConsole()->writeLine("######################## SYNCHROS ########################", ColorInterface::BLUE); $this->getConsole()->writeLine(); try { if ($all) { if ($name === null) { $synchros = $this->synchroService->getSynchros(); } else { try { Loading