diff --git a/batch/enrichissement.php b/batch/enrichissement.php index 48b93278..c2dc5b0b 100644 --- a/batch/enrichissement.php +++ b/batch/enrichissement.php @@ -81,8 +81,11 @@ if ($opts->id) if ( count($identifiants)>0 && count($dataProfil)>0 ) { - $config = new Zend_Config_Ini(APPLICATION_PATH.'/configs/configuration.ini'); + $mois = date('m-Y'); + if(!file_exists($config->path->data.'/'.$mois)) + mkdir($config->path->data.'/'.$mois); + $path = $config->path->data.'/'.$mois; $outFile = $opts->id.'_'.$profil['login'].'_'.date('YmdHis').'.csv'; require_once 'Scores/Enrichissement.php'; $dico = new Enrichissement(); @@ -112,7 +115,7 @@ if ( count($identifiants)>0 && count($dataProfil)>0 ) //Pour chaque identifiant traiter les données $row = 0; - $fp = fopen($config->path->data.'/'.$outFile, 'w'); + $fp = fopen($path.'/'.$outFile, 'w'); //Ecrire l'entete if (count($tabEnteteLabel)>0){ fputcsv($fp, $tabEnteteLabel, ',', '"');