diff --git a/library/Metier/Bodacc/MBodacc.php b/library/Metier/Bodacc/MBodacc.php index cecf3b05..b2252887 100644 --- a/library/Metier/Bodacc/MBodacc.php +++ b/library/Metier/Bodacc/MBodacc.php @@ -492,7 +492,7 @@ class Metier_Bodacc_MBodacc public function __construct($db = null) { if ( $db === null ) { - $this->iDb = new WDB(); + $this->iDb = new Metier_Util_Db(); } else { $this->iDb = $db; } diff --git a/library/Metier/Insee/MInsee.php b/library/Metier/Insee/MInsee.php index 29df5ece..7348705a 100644 --- a/library/Metier/Insee/MInsee.php +++ b/library/Metier/Insee/MInsee.php @@ -81,7 +81,7 @@ class Metier_Insee_MInsee extends Metier_Insee_Table public function __construct($db = null) { if ( $db === null ) { - $this->iDb = new WDB(); + $this->iDb = new Metier_Util_Db(); } else { $this->iDb = $db; } @@ -276,7 +276,7 @@ class Metier_Insee_MInsee extends Metier_Insee_Table { $tabAdr = $this->structureVoie(strtoupper($adresse)); $numAdresse = preg_replace('/^0+/','',''.$tabAdr['num']*1); - $adresse = trimAccent($tabAdr['libVoie']); + $adresse = Metier_Util_String::trimAccent($tabAdr['libVoie']); $formR = array( 'type' => 'ent', 'siret' => '', @@ -784,7 +784,7 @@ class Metier_Insee_MInsee extends Metier_Insee_Table if ($strLigneDAdresse=='') return $tabRet; $tabLignes=explode(',', preg_replace('/,$/', '', $strLigneDAdresse)); foreach ($tabLignes as $strLigneDAdresse) { - $strLigneDAdresse=trimAccent($strLigneDAdresse); + $strLigneDAdresse=Metier_Util_String::trimAccent($strLigneDAdresse); $strLigneDAdresse=preg_replace('/[^0-9a-zA-Z]/', ' ', $strLigneDAdresse); $strLigneDAdresse=trim(preg_replace('/ +/', ' ', $strLigneDAdresse)); //echo "1. Adresse nettoyées = $strLigneDAdresse".PHP_EOL; diff --git a/library/Metier/Partenaires/MAmabis.php b/library/Metier/Partenaires/MAmabis.php index b6b1c501..6c759eaf 100644 --- a/library/Metier/Partenaires/MAmabis.php +++ b/library/Metier/Partenaires/MAmabis.php @@ -10,7 +10,7 @@ class Metier_Partenaires_MAmabis public function __construct($db = null) { if ( $db === null ) { - $this->iDb = new WDB(); + $this->iDb = new Metier_Util_Db(); } else { $this->iDb = $db; } diff --git a/library/Metier/Partenaires/MArtisanat.php b/library/Metier/Partenaires/MArtisanat.php index e8a98969..4d460b81 100644 --- a/library/Metier/Partenaires/MArtisanat.php +++ b/library/Metier/Partenaires/MArtisanat.php @@ -14,7 +14,7 @@ class Metier_Partenaires_MArtisanat public $enCache=false; function __construct() { - $this->iDb=new WDB(); + $this->iDb=new Metier_Util_Db(); } function getIdentite($siren, $refresh=false) { diff --git a/library/Metier/Partenaires/MBanques.php b/library/Metier/Partenaires/MBanques.php index 56e732ba..c422b418 100644 --- a/library/Metier/Partenaires/MBanques.php +++ b/library/Metier/Partenaires/MBanques.php @@ -50,7 +50,7 @@ class Metier_Partenaires_MBanques function __construct($db = null) { if ( $db === null ) { - $this->iDb = new WDB(); + $this->iDb = new Metier_Util_Db(); } else { $this->iDb = $db; } diff --git a/library/Metier/Partenaires/MBilans.php b/library/Metier/Partenaires/MBilans.php index 27553e3d..884c32b7 100644 --- a/library/Metier/Partenaires/MBilans.php +++ b/library/Metier/Partenaires/MBilans.php @@ -275,7 +275,7 @@ class Metier_Partenaires_MBilans public function __construct($siren, $db = null) { if ( $db === null ) { - $this->iDb = new WDB(); + $this->iDb = new Metier_Util_Db(); } else { $this->iDb = $db; } diff --git a/library/Metier/Partenaires/MBourse.php b/library/Metier/Partenaires/MBourse.php index 0704c951..3e65164b 100644 --- a/library/Metier/Partenaires/MBourse.php +++ b/library/Metier/Partenaires/MBourse.php @@ -9,7 +9,7 @@ class Metier_Partenaires_MBourse $this->siren = $siren; if ( $db === null ) { - $this->iDb = new WDB(); + $this->iDb = new Metier_Util_Db(); } else { $this->iDb = $db; } diff --git a/library/Metier/Partenaires/MCadastre.php b/library/Metier/Partenaires/MCadastre.php index 678769a1..a28b11f1 100644 --- a/library/Metier/Partenaires/MCadastre.php +++ b/library/Metier/Partenaires/MCadastre.php @@ -126,7 +126,7 @@ class Metier_Partenaires_MCadastre { $this->siren = $siren; if ( $db === null ) { - $this->iDb = new WDB(); + $this->iDb = new Metier_Util_Db(); } else { $this->iDb = $db; } diff --git a/library/Metier/Partenaires/MFacto.php b/library/Metier/Partenaires/MFacto.php index 12c0a409..0fe86997 100644 --- a/library/Metier/Partenaires/MFacto.php +++ b/library/Metier/Partenaires/MFacto.php @@ -88,7 +88,7 @@ class Metier_Partenaires_MFacto public function __construct($db = null) { if ( $db === null ) { - $this->iDb = new WDB(); + $this->iDb = new Metier_Util_Db(); } else { $this->iDb = $db; } diff --git a/library/Metier/Partenaires/MGreffes.php b/library/Metier/Partenaires/MGreffes.php index 5d7385f5..7984718a 100644 --- a/library/Metier/Partenaires/MGreffes.php +++ b/library/Metier/Partenaires/MGreffes.php @@ -6,7 +6,7 @@ class Metier_Partenaires_MGreffes public function __construct($db = null) { if ( $db === null ) { - $this->iDb = new WDB(); + $this->iDb = new Metier_Util_Db(); } else { $this->iDb = $db; } diff --git a/library/Metier/Partenaires/MLiens.php b/library/Metier/Partenaires/MLiens.php index 5d007bd8..a36471d9 100644 --- a/library/Metier/Partenaires/MLiens.php +++ b/library/Metier/Partenaires/MLiens.php @@ -38,7 +38,7 @@ class Metier_Partenaires_MLiens public function __construct($siren) { $this->siren=$siren; - $this->iDb=new WDB(); + $this->iDb=new Metier_Util_Db(); $this->iInsee=new Metier_Insee_MInsee(); } diff --git a/library/Metier/Partenaires/MMap.php b/library/Metier/Partenaires/MMap.php index d4168cf0..9156b667 100644 --- a/library/Metier/Partenaires/MMap.php +++ b/library/Metier/Partenaires/MMap.php @@ -517,7 +517,7 @@ class Metier_Partenaires_MMap { public function __construct($accesDist=true, $db = null) { if ( $db === null ) { - $this->iDb = new WDB(); + $this->iDb = new Metier_Util_Db(); } else { $this->iDb = $db; } diff --git a/library/Metier/Partenaires/MMarques.php b/library/Metier/Partenaires/MMarques.php index 38d7e63a..b61bf608 100644 --- a/library/Metier/Partenaires/MMarques.php +++ b/library/Metier/Partenaires/MMarques.php @@ -24,7 +24,7 @@ class Metier_Partenaires_MMarques $this->partConnection(); if ( $db === null ) { - $this->iDb = new WDB(); + $this->iDb = new Metier_Util_Db(); } else { $this->iDb = $db; } diff --git a/library/Metier/Partenaires/MOrias.php b/library/Metier/Partenaires/MOrias.php index 34c91ecf..ab5dc143 100644 --- a/library/Metier/Partenaires/MOrias.php +++ b/library/Metier/Partenaires/MOrias.php @@ -21,7 +21,7 @@ class Metier_Partenaires_MOrias $this->accesDist = $accesDist; if ( $db === null ) { - $this->iDb = new WDB(); + $this->iDb = new Metier_Util_Db(); } else { $this->iDb = $db; } diff --git a/library/Metier/Partenaires/MPrivileges.php b/library/Metier/Partenaires/MPrivileges.php index a483a41b..873f28f6 100644 --- a/library/Metier/Partenaires/MPrivileges.php +++ b/library/Metier/Partenaires/MPrivileges.php @@ -70,7 +70,7 @@ class Metier_Partenaires_MPrivileges public function __construct($db = null) { if ( $db === null ) { - $this->iDb = new WDB(); + $this->iDb = new Metier_Util_Db(); } else { $this->iDb = $db; } diff --git a/library/Metier/Partenaires/MQualibat.php b/library/Metier/Partenaires/MQualibat.php index 3ebc320d..1c85fbaa 100644 --- a/library/Metier/Partenaires/MQualibat.php +++ b/library/Metier/Partenaires/MQualibat.php @@ -18,7 +18,7 @@ class Metier_Partenaires_MQualibat { function __construct($accesDist=true) {// $adresse, $cp, $ville, $pays='France') { $this->accesDist=$accesDist; - $this->iDb=new WDB(); + $this->iDb=new Metier_Util_Db(); $this->iBodacc=new Metier_Bodacc_MBodacc(); $this->$iInsee=new Metier_Insee_MInsee(); } diff --git a/library/Metier/Partenaires/MRncs.php b/library/Metier/Partenaires/MRncs.php index 0a0d997c..84e09210 100644 --- a/library/Metier/Partenaires/MRncs.php +++ b/library/Metier/Partenaires/MRncs.php @@ -56,7 +56,7 @@ class Metier_Partenaires_MRncs public function __construct($db = null) { if ( $db === null ) { - $this->iDb = new WDB(); + $this->iDb = new Metier_Util_Db(); } else { $this->iDb = $db; } diff --git a/library/Metier/Partenaires/MRnvp.php b/library/Metier/Partenaires/MRnvp.php index 7e4d1a3f..4fa4ab65 100644 --- a/library/Metier/Partenaires/MRnvp.php +++ b/library/Metier/Partenaires/MRnvp.php @@ -28,7 +28,7 @@ class Metier_Partenaires_MRnvp ); function __construct() { - $this->iDb = new WDB(); + $this->iDb = new Metier_Util_Db(); $this->iInsee = new Metier_Insee_MInsee($this->iDb); } diff --git a/library/Metier/Partenaires/MTel.php b/library/Metier/Partenaires/MTel.php index 0b1531f1..2218f8ac 100644 --- a/library/Metier/Partenaires/MTel.php +++ b/library/Metier/Partenaires/MTel.php @@ -29,7 +29,7 @@ class Metier_Partenaires_MTel $this->codeRetour=$page['code']; } if ( $db === null ) { - $this->iDb = new WDB(); + $this->iDb = new Metier_Util_Db(); } else { $this->iDb = $db; } diff --git a/library/Metier/Partenaires/MTva.php b/library/Metier/Partenaires/MTva.php index 26b3d54b..4c14f265 100644 --- a/library/Metier/Partenaires/MTva.php +++ b/library/Metier/Partenaires/MTva.php @@ -21,7 +21,7 @@ class Metier_Partenaires_MTva } if ( $db === null ) { - $this->iDb = new WDB(); + $this->iDb = new Metier_Util_Db(); } else { $this->iDb = $db; } diff --git a/library/Metier/Scores/ICotation.php b/library/Metier/Scores/ICotation.php index 82aee7ee..7318981f 100644 --- a/library/Metier/Scores/ICotation.php +++ b/library/Metier/Scores/ICotation.php @@ -24,7 +24,7 @@ class Metier_Scores_ICotation function __construct($tabBilan, $retraitementAutomatique = true, $db = null) { if ( $db === null ) { - $this->iDb = new WDB(); + $this->iDb = new Metier_Util_Db(); } else { $this->iDb = $db; } diff --git a/library/Metier/Scores/MRatios.php b/library/Metier/Scores/MRatios.php index b695f9e4..bdec3ff3 100644 --- a/library/Metier/Scores/MRatios.php +++ b/library/Metier/Scores/MRatios.php @@ -215,7 +215,7 @@ class Metier_Scores_MRatios public function __construct($db = null) { if ( $db === null ) { - $this->iDb = new WDB(); + $this->iDb = new Metier_Util_Db(); } else { $this->iDb = $db; } diff --git a/library/Metier/Scores/MScores.php b/library/Metier/Scores/MScores.php index d36f0173..0831ae2d 100644 --- a/library/Metier/Scores/MScores.php +++ b/library/Metier/Scores/MScores.php @@ -19,7 +19,7 @@ function getIndiscoreHisto($siren) WHERE siren=$siren GROUP BY indiScoreDate ORDER BY indiScoreDate DESC"; - $iDb = new WDB(); + $iDb = new Metier_Util_Db(); $ret = $iDb->query($query); $tabRet = array(); while( $ret = $iDb->fetch(MYSQL_ASSOC) ) { @@ -73,7 +73,7 @@ function getIndiscoreCache($siren) FROM jo.scores_surveillance WHERE siren=$siren ORDER BY indiScoreDate DESC"; - $iDb = new WDB(); + $iDb = new Metier_Util_Db(); $ret = $iDb->query($query); $tabRet = array(); while( $ret = $iDb->fetch(MYSQL_ASSOC) ) { @@ -647,7 +647,7 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail $NIVEAU = $cycleClient; // 1, 2, 3 ou 5 Niveau de version des commentaires if ( $db === null ) { - $iDb = new WDB(); + $iDb = new Metier_Util_Db(); } else { $iDb = $db; } diff --git a/library/Metier/Scores/MSolvabilite.php b/library/Metier/Scores/MSolvabilite.php index b4406b85..74b19f1c 100644 --- a/library/Metier/Scores/MSolvabilite.php +++ b/library/Metier/Scores/MSolvabilite.php @@ -1042,7 +1042,7 @@ class Metier_Scores_MSolvabilite public function __construct($siren, $naf='', $trancheEff='', $effectifReel='', $depSiege_CodePosSiege='', $fj='', $capital='', $capitalDev='', $dateCreaEn='', $dateCreaSiege='', $singularite='', $recme=0, $db = null) { if ( $db === null ) { - $this->iDb = new WDB(); + $this->iDb = new Metier_Util_Db(); } else { $this->iDb = $db; } diff --git a/library/Metier/Util/Log.php b/library/Metier/Util/Log.php index cc9bed75..0b45ec2d 100644 --- a/library/Metier/Util/Log.php +++ b/library/Metier/Util/Log.php @@ -18,7 +18,7 @@ class Metier_Util_Log } else { file_put_contents(LOG_PATH.'/debugError.log', date('Y/m/d-H:i:s') .';'. $level .';'. $_SERVER['PHP_SELF'] .';'. $_SERVER['PHP_AUTH_USER'] .';'. $_SERVER['PHP_AUTH_PW'] .';'. $_SERVER['REMOTE_ADDR'] .';'. $_SERVER['HTTP_SOAPACTION'] .';'.$line.';'. $file.';'. $function.';'. $class .';'. - @gethostbyaddr($_SERVER['REMOTE_ADDR']) .';'. $HTTP_RAW_POST_DATA .';'. @memory_get_usage().';'. $message . PHP_EOL, FILE_APPEND); + @gethostbyaddr($_SERVER['REMOTE_ADDR']) .';'. 'php://input' .';'. @memory_get_usage().';'. $message . "\n", FILE_APPEND); } } else { if (!file_exists(LOG_PATH.'/debug.log')) { @@ -28,7 +28,7 @@ class Metier_Util_Log date('Y/m/d-H:i:s') .';'. $level .';'. $_SERVER['PHP_SELF'] .';'. $_SERVER['PHP_AUTH_USER'] .';'. $_SERVER['PHP_AUTH_PW'] .';'. $_SERVER['REMOTE_ADDR'] .';'. $_SERVER['HTTP_SOAPACTION'] .';'. $line.';'. $file.';'. $function.';'. $class .';'. @gethostbyaddr($_SERVER['REMOTE_ADDR']) .';'. - $HTTP_RAW_POST_DATA .';'. @memory_get_usage().';'. $message . PHP_EOL, FILE_APPEND); + 'php://input' .';'. @memory_get_usage().';'. $message . "\n", FILE_APPEND); } } } diff --git a/library/SdMetier/Scoring/Base.php b/library/SdMetier/Scoring/Base.php index 333e9b2b..0df02bdb 100644 --- a/library/SdMetier/Scoring/Base.php +++ b/library/SdMetier/Scoring/Base.php @@ -72,7 +72,7 @@ class SdMetier_Scoring_Base extends SdMetier_Scoring_Vars public function __construct($db = null) { if ( $db === null ) { - $this->db = new WDB(); + $this->db = new Metier_Util_Db(); } // --- Initialisation tableau libellé des variables @@ -124,7 +124,7 @@ class SdMetier_Scoring_Base extends SdMetier_Scoring_Vars WHERE siren=$siren GROUP BY indiScoreDate ORDER BY indiScoreDate DESC"; - $iDb = new WDB(); + $iDb = new Metier_Util_Db(); $ret = $iDb->query($query); $tabRet = array(); while( $ret = $iDb->fetch(MYSQL_ASSOC) ) { diff --git a/scripts/jobs/enrichissement.php b/scripts/jobs/enrichissement.php index 9d79da6a..5238814a 100644 --- a/scripts/jobs/enrichissement.php +++ b/scripts/jobs/enrichissement.php @@ -589,7 +589,7 @@ if ( $opts->reprise ) { $row = 0; $doublonList = array(); -$iDb = new WDB(); +$iDb = new Metier_Util_Db(); //Vérification et création des données foreach($tabIdentifiant as $item) @@ -1446,7 +1446,7 @@ function privilegeData($siren, $nic, $values = false) if ($nbPrivileges>0) { $return = 'Oui'; } else { - $iDb = new WDB('sdv1'); + $iDb = new Metier_Util_Db(); $sql = "SELECT count(*) AS nbPriv FROM ge_cs2 WHERE cs = 'P' AND dateFin >= NOW() AND dateSuppr=0 AND siren='$siren';"; $ret = $iDb->query($sql); if (count($ret) > 0) {