Modification des clés de config
This commit is contained in:
parent
398ad2dba1
commit
be208b9b80
@ -62,19 +62,34 @@ class FileController extends AbstractActionController
|
||||
$verbose = $request->getParam('verbose', false) || $request->getParam('v', false);
|
||||
$dryrun = $request->getParam('dry-run', false) || $request->getParam('n', false);
|
||||
|
||||
// Get config
|
||||
$globalConfig = array();
|
||||
|
||||
// Get file not sent
|
||||
$results = $this->entityManager->getRepository('Application\Entity\FluxFileout')->getNotSent();
|
||||
if (count($results) == 0) {
|
||||
$this->output("Rien à traiter.", $verbose);
|
||||
// Get definition
|
||||
$reposConfig = array();
|
||||
if (array_key_exists('repository', $this->appConfig)) {
|
||||
$reposConfig = $this->appConfig['repository'];
|
||||
}
|
||||
|
||||
if (count($reposConfig) == 0 || count($globalConfig) == 0) {
|
||||
$this->output("Aucune configuration.");
|
||||
} else {
|
||||
foreach($results as $result) {
|
||||
// Get file not sent
|
||||
$results = $this->entityManager
|
||||
->getRepository('Application\Entity\FluxFileout')->getNotSent();
|
||||
if (count($results) == 0) {
|
||||
$this->output("Rien à traiter.", $verbose);
|
||||
}
|
||||
// Browse files to exec operation
|
||||
else {
|
||||
foreach($results as $result) {
|
||||
|
||||
|
||||
|
||||
|
||||
echo $result->getFileout();
|
||||
$this->output("", $verbose);
|
||||
echo $result->getFileout();
|
||||
$this->output("", $verbose);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -12,9 +12,14 @@ class FileControllerFactory implements FactoryInterface
|
||||
{
|
||||
$serviceLocator = $serviceLocator->getServiceLocator();
|
||||
$console = $serviceLocator->get('Console');
|
||||
$config = $serviceLocator->get('config');
|
||||
$appConfig = $serviceLocator->get('config');
|
||||
$em = $serviceLocator->get('Doctrine\ORM\EntityManager');
|
||||
|
||||
$config = array();
|
||||
if (array_key_exists('flux', $appConfig)) {
|
||||
$config = $appConfig['flux'];
|
||||
}
|
||||
|
||||
return new FileController($console, $em, $config);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user