diff --git a/bin/clientRapportsTexte.php b/bin/clientRapportsTexte.php index 9ad15b40..186dc3dc 100644 --- a/bin/clientRapportsTexte.php +++ b/bin/clientRapportsTexte.php @@ -21,14 +21,6 @@ require_once realpath(__DIR__ . '/../vendor/autoload.php'); // --- Create application, bootstrap, and run $application = new Zend_Application(APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini'); -$c = new Zend_Config($application->getOptions()); - -// Stockage Client => SD -$pathClientSend = '/home/scores/batch/shared/clients/fransbonhomme/send'; - -// Stockage SD => Client -$pathClientRecv = '/home/scores/batch/shared/clients/fransbonhomme/recv'; - // --- Options $displayUsage = false; try { @@ -56,9 +48,36 @@ if ($displayUsage) { exit; } +$c = new Zend_Config($application->getOptions()); + +// Stockage Client => SD +$pathClientSend = '/home/scores/batch/shared/clients/fransbonhomme/send'; + +// Stockage SD => Client +$pathClientRecv = '/home/scores/batch/shared/clients/fransbonhomme/recv'; + $db = Zend_Db::factory($c->profil->db->metier); Zend_Db_Table::setDefaultAdapter($db); +// Database +$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, + 'charset' => 'utf8', + 'driver' => 'pdo_mysql', +); + +try { + $conn = \Doctrine\DBAL\DriverManager::getConnection($connectionParams, $config); + Zend_Registry::set('doctrine', $conn); +} catch (\Doctrine\DBAL\DBALException $e) { + echo "Connection Database impossible.\n"; + exit; +} + $execRef = new Scores_Exec_Ref('RAPPORTSTEXTE'); $execId = $execRef->start(); diff --git a/bin/clientRrgSurv.php b/bin/clientRrgSurv.php index 20ceac1f..ee1bc96f 100644 --- a/bin/clientRrgSurv.php +++ b/bin/clientRrgSurv.php @@ -46,6 +46,25 @@ if ($displayUsage) { $c = new Zend_Config($application->getOptions()); Zend_Registry::set('config', $c); +// Database +$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, + 'charset' => 'utf8', + 'driver' => 'pdo_mysql', +); + +try { + $conn = \Doctrine\DBAL\DriverManager::getConnection($connectionParams, $config); + Zend_Registry::set('doctrine', $conn); +} catch (\Doctrine\DBAL\DBALException $e) { + echo "Connection Database impossible.\n"; + exit; +} + $login = 'rrgws'; $client = 'rrg'; $typeDepot = 'FTP'; diff --git a/bin/clientSfrIndicateur.php b/bin/clientSfrIndicateur.php index 7358a5ef..2419234d 100644 --- a/bin/clientSfrIndicateur.php +++ b/bin/clientSfrIndicateur.php @@ -54,6 +54,25 @@ $c = new Zend_Config($application->getOptions()); $db = Zend_Db::factory($c->profil->db->metier); Zend_Db_Table_Abstract::setDefaultAdapter($db); +// Database +$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, + 'charset' => 'utf8', + 'driver' => 'pdo_mysql', +); + +try { + $conn = \Doctrine\DBAL\DriverManager::getConnection($connectionParams, $config); + Zend_Registry::set('doctrine', $conn); +} catch (\Doctrine\DBAL\DBALException $e) { + echo "Connection Database impossible.\n"; + exit; +} + $client = 'sfrbtr'; $typeDepot = 'SFTP'; $prestation = 'FICH_RCE'; diff --git a/bin/clientSfrSurv.php b/bin/clientSfrSurv.php index 8d0a8abe..a27b0455 100644 --- a/bin/clientSfrSurv.php +++ b/bin/clientSfrSurv.php @@ -52,6 +52,25 @@ if ( $opts->in ) { $db = Zend_Db::factory($c->profil->db->metier); Zend_Db_Table_Abstract::setDefaultAdapter($db); + // Database + $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, + 'charset' => 'utf8', + 'driver' => 'pdo_mysql', + ); + + try { + $conn = \Doctrine\DBAL\DriverManager::getConnection($connectionParams, $config); + Zend_Registry::set('doctrine', $conn); + } catch (\Doctrine\DBAL\DBALException $e) { + echo "Connection Database impossible.\n"; + exit; + } + $execRef = new Scores_Exec_Ref('SFRSURV'); $execId = $execRef->start(); diff --git a/bin/dataBilanPostes.php b/bin/dataBilanPostes.php index 6c01af07..3d77b3e1 100644 --- a/bin/dataBilanPostes.php +++ b/bin/dataBilanPostes.php @@ -24,6 +24,25 @@ Zend_Registry::set('config', $c); $db = Zend_Db::factory($c->profil->db->metier); Zend_Db_Table_Abstract::setDefaultAdapter($db); +// Database +$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, + 'charset' => 'utf8', + 'driver' => 'pdo_mysql', +); + +try { + $conn = \Doctrine\DBAL\DriverManager::getConnection($connectionParams, $config); + Zend_Registry::set('doctrine', $conn); +} catch (\Doctrine\DBAL\DBALException $e) { + echo "Connection Database impossible.\n"; + exit; +} + require_once APPLICATION_PATH.'/configs/config.php'; $tabPostes = array('AA','AA2','AB','AC','AC1','AD','AE','AE1','AF','AG','AG1','AH','AI','AI1','AJ','AK','AK1','AL','AM','AM1','AN','AO','AO1','AP','AQ','AQ1','AR','AS','AS1','AT','AU','AU1','AV','AW','AW1','AX','AY','AY1','CS','CT','CT1','CU','CV','CV1','BB','BC','BC1','BD','BE','BE1','BF','BG','BG1','BH','BI','BI1','BJ','BK','BK1','BL','BM','BM1','BN','BO','BO1','BP','BQ','BQ1','BR','BS','BS1','BT','BU','BU1','BV','BW','BW1','BX','BY','BY1','BZ','CA','CA1','CB','CC','CC1','CD','CE','CE1','CF','CG','CG1','CH','CI','CI1','CJ','CK','CK1','CL','CL2','CM','CM2','CN','CN2','CO','1A','1A1','CP','CR','DA','DB','EK','DC','DD','DE','B1','DF','EJ','DG','DH','DI','DJ','DK','DL','DM','DN','DO','DP','DQ','DR','DS','DT','DU','DV','DW','DX','DY','DZ','EA','EB','EC','ED','EE','EF','EG','EH','EI','FA','FB','FC','FD','FE','FF','FG','FH','FI','FJ','FK','FL','FM','FN','FO','FP','FQ','FR','FS','FT','FU','FV','FW','FX','FY','FZ','GA','GB','GC','GD','GE','GF','GG','GH','GI','GJ','GK','GL','GM','GN','GO','GP','GQ','GR','GS','GT','GU','GV','GW','HA','HB','HC','HD','HE','HF','HG','HH','HI','HJ','HK','HL','HM','HN','HP','HQ','A1','A2','A3','A4','A6','A9','KA','KB','KC','KD','KE','KF','LN','LO','LP','LQ','LR','LS','0G','0H','0J','NL','LT','LU','1W','N0','LV','LW','1X','MY','MZ','NA','NB','NC','ND','NE','NF','NN','NG','NH','NI','I2','2E','2F','2G','NM','NJ','NK','2H','NP','0K','0L','0M','PA','PB','PC','PD','PE','PF','PG','PH','QU','QV','QW','QX','0N','0P','0Q','0R','SM0','SI','SM','SN','SP0','SO','SP','SR','3X','TM','TN','TO','3Z','TS','TT','TU','4A','4B','4C','4D','4E','4F','4G','4H','4J','4K','4L','4M','4N','4P','4R','4S','4T','4U','4V','4W','4X','4Y','4Z','5A','5B','5C','5D','5E','5F','5G','5J','5K','5L','5M','5N','5P','5R','5S','5T','5U','5V','5W','5X','5Y','5Z','TV','TW','TX','6A','6B','6C','6D','6E','6F','6G','6H','02','03','04','05','9U','9V','9W','9X','06','07','08','09','6N','6P','6R','6S','6T','6U','6V','6W','6X','6Y','6Z','7A','7B','TY','TZ','UA','7C','UB','UC','UD','UE','UF','UG','UH','UJ','UK','UL','UM','UN','UP','UR','US','UT','UV','UW','VA','VA1','VA2','UX','UX1','UX2','UQ','U0','UU','UU1','UU2','UY','UY1','UY2','UZ','UZ1','UZ2','VM','VM1','VM2','VB','VB1','VB2','VN','VN1','VN2','VP','VP1','VP2','VC','VC1','VC2','VR','VR1','VR2','VS','VS1','VS2','VT','VU','VV','7Y','7Y1','7Y2','7Y3','7Z','7Z1','7Z2','7Z3','VG','VG1','VG2','VG3','VH','VH1','VH2','VH3','8A','8A1','8A2','8A3','8B','8B1','8B2','8B3','8C','8C1','8C2','8C3','8D','8D1','8D2','8D3','8E','8E1','8E2','8E3','VW','VW1','VW2','VW3','VX','VX1','VX2','VX3','VQ','VQ1','VQ2','VQ3','8J','8J1','8J2','8J3','VI','VI1','VI2','VI3','8K','8K1','8K2','8K3','SZ','SZ1','SZ2','SZ3','8L','8L1','8L2','8L3','VY','VZ','VZ1','VZ2','VJ','VL','VK','ZE','YQ','YR','YS','YT','XQ','YU','SS','YV','ST','ZJ','YW','9Z','YX','YY','YZ','YP','ZR'); diff --git a/bin/dataScoreSurv.php b/bin/dataScoreSurv.php index 432590c2..2df779dc 100644 --- a/bin/dataScoreSurv.php +++ b/bin/dataScoreSurv.php @@ -133,6 +133,25 @@ $c = new Zend_Config($application->getOptions()); $db = Zend_Db::factory($c->profil->db->metier); Zend_Db_Table_Abstract::setDefaultAdapter($db); +// Database +$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, + 'charset' => 'utf8', + 'driver' => 'pdo_mysql', +); + +try { + $conn = \Doctrine\DBAL\DriverManager::getConnection($connectionParams, $config); + Zend_Registry::set('doctrine', $conn); +} catch (\Doctrine\DBAL\DBALException $e) { + echo "Connection Database impossible.\n"; + exit; +} + /** * Delete all temporary table */ diff --git a/bin/prestaA6cmoEntrep.php b/bin/prestaA6cmoEntrep.php index 2efccd21..0995ce98 100644 --- a/bin/prestaA6cmoEntrep.php +++ b/bin/prestaA6cmoEntrep.php @@ -75,6 +75,25 @@ $appconfig = new Zend_Config($application->getOptions()); $db = Zend_Db::factory($appconfig->profil->db->metier); Zend_Db_Table_Abstract::setDefaultAdapter($db); +// Database +$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, + 'charset' => 'utf8', + 'driver' => 'pdo_mysql', +); + +try { + $conn = \Doctrine\DBAL\DriverManager::getConnection($connectionParams, $config); + Zend_Registry::set('doctrine', $conn); +} catch (\Doctrine\DBAL\DBALException $e) { + echo "Connection Database impossible.\n"; + exit; +} + // --- Liste des paramètres $defineParams = array( 'nomClient', diff --git a/bin/sourceDila.php b/bin/sourceDila.php index 92e3d206..645321aa 100644 --- a/bin/sourceDila.php +++ b/bin/sourceDila.php @@ -70,6 +70,25 @@ $c = new Zend_Config($application->getOptions()); $db = Zend_Db::factory($c->profil->db->metier); Zend_Db_Table_Abstract::setDefaultAdapter($db); +// Database +$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, + 'charset' => 'utf8', + 'driver' => 'pdo_mysql', +); + +try { + $conn = \Doctrine\DBAL\DriverManager::getConnection($connectionParams, $config); + Zend_Registry::set('doctrine', $conn); +} catch (\Doctrine\DBAL\DBALException $e) { + echo "Connection Database impossible.\n"; + exit; +} + $STORAGEBASE = "/home/scores/batch/shared/sources/dila"; if ($opts->from == 'restricted') { diff --git a/bin/sourceInpiDecisions.php b/bin/sourceInpiDecisions.php index 519189b3..c506dc3c 100644 --- a/bin/sourceInpiDecisions.php +++ b/bin/sourceInpiDecisions.php @@ -18,13 +18,33 @@ require_once realpath(__DIR__ . '/../vendor/autoload.php'); // --- Create application, bootstrap, and run $application = new Zend_Application(APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini'); +require_once APPLICATION_PATH.'/configs/config.php'; $c = new Zend_Config($application->getOptions()); Zend_Registry::set('config', $c); $db = Zend_Db::factory($c->profil->db->metier); Zend_Db_Table::setDefaultAdapter($db); -require_once APPLICATION_PATH.'/configs/config.php'; +// Database +$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, + 'charset' => 'utf8', + 'driver' => 'pdo_mysql', +); + +try { + $conn = \Doctrine\DBAL\DriverManager::getConnection($connectionParams, $config); + Zend_Registry::set('doctrine', $conn); +} catch (\Doctrine\DBAL\DBALException $e) { + echo "Connection Database impossible.\n"; + exit; +} + + $table='jo.annonces'; diff --git a/bin/sourceInsee.php b/bin/sourceInsee.php index 3d19210b..c275b5b5 100644 --- a/bin/sourceInsee.php +++ b/bin/sourceInsee.php @@ -55,6 +55,25 @@ $c = new Zend_Config($application->getOptions()); $db = Zend_Db::factory($c->profil->db->metier); Zend_Db_Table_Abstract::setDefaultAdapter($db); +// Database +$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, + 'charset' => 'utf8', + 'driver' => 'pdo_mysql', +); + +try { + $conn = \Doctrine\DBAL\DriverManager::getConnection($connectionParams, $config); + Zend_Registry::set('doctrine', $conn); +} catch (\Doctrine\DBAL\DBALException $e) { + echo "Connection Database impossible.\n"; + exit; +} + $storageDir = $STORAGEBASE . '/' . date('Y'); if (!file_exists($storageDir)) { mkdir($storageDir, 0777, true); diff --git a/bin/sourceJalPdf.php b/bin/sourceJalPdf.php index 888e652b..7debf9a6 100644 --- a/bin/sourceJalPdf.php +++ b/bin/sourceJalPdf.php @@ -61,6 +61,25 @@ Zend_Registry::set('config', $c); $db = Zend_Db::factory($c->profil->db->metier); Zend_Db_Table_Abstract::setDefaultAdapter($db); +// Database +$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, + 'charset' => 'utf8', + 'driver' => 'pdo_mysql', +); + +try { + $conn = \Doctrine\DBAL\DriverManager::getConnection($connectionParams, $config); + Zend_Registry::set('doctrine', $conn); +} catch (\Doctrine\DBAL\DBALException $e) { + echo "Connection Database impossible.\n"; + exit; +} + if ($opts->cron) { diff --git a/bin/sourceJalTable.php b/bin/sourceJalTable.php index 3a2a5faf..27b59520 100644 --- a/bin/sourceJalTable.php +++ b/bin/sourceJalTable.php @@ -43,6 +43,25 @@ $c = new Zend_Config($application->getOptions()); $db = Zend_Db::factory($c->profil->db->metier); Zend_Db_Table_Abstract::setDefaultAdapter($db); +// Database +$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, + 'charset' => 'utf8', + 'driver' => 'pdo_mysql', +); + +try { + $conn = \Doctrine\DBAL\DriverManager::getConnection($connectionParams, $config); + Zend_Registry::set('doctrine', $conn); +} catch (\Doctrine\DBAL\DBALException $e) { + echo "Connection Database impossible.\n"; + exit; +} + $requests = array( 'REF_CodeJournal_' => array( 'header' => array('id', 'nomJALedition', 'parution', 'parutionJours', 'aboDateDeb', 'aboDateFin', 'priorite'),