From 277467012f268a0b01ce389b35523c47691c3d02 Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Wed, 18 Apr 2012 14:04:24 +0000 Subject: [PATCH] Petit correction sur l'enrichissement --- batch/enrichissement.php | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/batch/enrichissement.php b/batch/enrichissement.php index 6d123328..04ff18a8 100644 --- a/batch/enrichissement.php +++ b/batch/enrichissement.php @@ -227,7 +227,16 @@ $tabDico = array( ), ); -//Définition bdd +//MetadataCache pour la base de données +$frontendOptions = array( + 'lifetime' => 14400, + 'automatic_serialization' => true +); +$backendOptions = array(); +$cache = Zend_Cache::factory('Core','Apc', $frontendOptions, $backendOptions); +Zend_Db_Table_Abstract::setDefaultMetadataCache($cache); + +//Définition bdd local $dbConfig = new Zend_Config_Ini(APPLICATION_PATH . '/configs/configuration.ini', 'databases'); try { $db = Zend_Db::factory($dbConfig->db); @@ -261,15 +270,6 @@ require_once realpath(dirname(__FILE__)).'/../config/config.php'; require_once 'framework/fwk.php'; require_once 'Metier/insee/classMInsee.php'; -//MetadataCache pour la base de données -$frontendOptions = array( - 'lifetime' => 14400, - 'automatic_serialization' => true -); -$backendOptions = array(); -$cache = Zend_Cache::factory('Core','Apc', $frontendOptions, $backendOptions); -Zend_Db_Table_Abstract::setDefaultMetadataCache($cache); - //Définition bdd metier $dbConfig = array( 'host' => MYSQL_HOST, @@ -277,6 +277,7 @@ $dbConfig = array( 'username' => MYSQL_USER, 'password' => MYSQL_PASS, 'dbname' => MYSQL_DEFAULT_DB, + 'persistent' => true, 'driver_options' => array(MYSQLI_INIT_COMMAND => 'SET NAMES UTF8;'), ); try { @@ -403,7 +404,6 @@ foreach($tabExtract as $key) } } } - //Ajout colonne obligatoire SiretValide $tabEntete[] = 'SiretValide'; unset($tabExtract); @@ -544,9 +544,7 @@ foreach($tabIdentifiant as $item) } fclose($fp); if ($opts->id) { - $commandesM->update(array( - 'dateStop' => date('Y-m-d H:i:s'), - ), "id = ".$commande->id); + $commandesM->update( array('dateStop' => date('Y-m-d H:i:s')) , "id = ".$commande->id); }