Modification des clés de config

This commit is contained in:
Michael RICOIS 2016-07-22 16:34:44 +02:00
parent 398ad2dba1
commit be208b9b80
2 changed files with 28 additions and 8 deletions

View File

@ -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);
}
}
}

View File

@ -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);
}
}