Config App
This commit is contained in:
parent
97a3ba82d5
commit
f317addf6a
@ -263,11 +263,11 @@ $tabDico = array(
|
||||
);
|
||||
|
||||
//Définition bdd local
|
||||
$c = new Zend_Config($application->getOptions());
|
||||
Zend_Registry::set('config', $c);
|
||||
$configApp = new Zend_Config($application->getOptions());
|
||||
Zend_Registry::set('config', $configApp);
|
||||
try {
|
||||
$db = Zend_Db::factory($c->resources->db);
|
||||
$dbMetier = Zend_Db::factory($c->profil->db->metier);
|
||||
$db = Zend_Db::factory($configApp->resources->db);
|
||||
$dbMetier = Zend_Db::factory($configApp->profil->db->metier);
|
||||
Zend_Db_Table::setDefaultAdapter($dbMetier);
|
||||
} catch ( Exception $e ) {
|
||||
exit ( $e->getMessage() );
|
||||
@ -276,10 +276,10 @@ try {
|
||||
// Doctrine conn
|
||||
$config = new \Doctrine\DBAL\Configuration();
|
||||
$connectionParams = array(
|
||||
'dbname' => $c->profil->db->metier->params->dbname,
|
||||
'user' => $c->profil->db->metier->params->username,
|
||||
'password' => $c->profil->db->metier->params->password,
|
||||
'host' => $c->profil->db->metier->params->host,
|
||||
'dbname' => $configApp->profil->db->metier->params->dbname,
|
||||
'user' => $configApp->profil->db->metier->params->username,
|
||||
'password' => $configApp->profil->db->metier->params->password,
|
||||
'host' => $configApp->profil->db->metier->params->host,
|
||||
'charset' => 'utf8',
|
||||
'driver' => 'pdo_mysql',
|
||||
);
|
||||
@ -309,7 +309,7 @@ if ($opts->id) {
|
||||
$extension = strrchr($file,'.');
|
||||
$file = str_replace($extension, '', $file);
|
||||
|
||||
if (!file_exists($c->profil->path->data.'/export')) mkdir($c->profil->path->data.'/export');
|
||||
if (!file_exists($configApp->profil->path->data.'/export')) mkdir($configApp->profil->path->data.'/export');
|
||||
|
||||
if ($opts->id) {
|
||||
$profilM = new Application_Model_Profil($db);
|
||||
@ -336,7 +336,7 @@ $tabData = array();
|
||||
$posKeySiren = $posKeySiret = $posKeyNic = $posKeySpecial = false;
|
||||
|
||||
//Fichier de définition
|
||||
$inFile = $c->profil->path->data.'/clients/'.$file.'.csv';
|
||||
$inFile = $configApp->profil->path->data.'/clients/'.$file.'.csv';
|
||||
|
||||
//Lire le fichier csv
|
||||
$row = 0;
|
||||
@ -544,7 +544,7 @@ if (count($tabEntete)>0){
|
||||
|
||||
//Définition du fichier de sortie
|
||||
if ( $opts->reprise ) {
|
||||
$outFile = $c->profil->path->data.'/export/'.$commande->fichierOut;
|
||||
$outFile = $configApp->profil->path->data.'/export/'.$commande->fichierOut;
|
||||
$rowReprise = 0;
|
||||
$fp = fopen($outFile, 'r+');
|
||||
if ($fp === false) {
|
||||
@ -556,7 +556,7 @@ if ( $opts->reprise ) {
|
||||
}
|
||||
|
||||
} else {
|
||||
$outFile = $c->profil->path->data.'/export/'.$file.'-'.date('YmdHis').'.csv';
|
||||
$outFile = $configApp->profil->path->data.'/export/'.$file.'-'.date('YmdHis').'.csv';
|
||||
//Ecriture de l'entete du fichier
|
||||
$fp = fopen($outFile, 'w');
|
||||
if ($fp === false) {
|
||||
|
Loading…
Reference in New Issue
Block a user