diff --git a/application/Bootstrap.php b/application/Bootstrap.php index 2c5185a02..6028aaf5f 100644 --- a/application/Bootstrap.php +++ b/application/Bootstrap.php @@ -1,4 +1,9 @@ getOptions()); + $logFile = $config->profil->path->shared.'/log/application.log'; + + $log = new Logger('APP'); + + // Console Handler + if (in_array(APPLICATION_ENV, array('development', 'staging'))) { + $log->pushHandler(new BrowserConsoleHandler()); + } + + // File Handler + if (APPLICATION_ENV == 'development') { + $level = Logger::DEBUG; + } else { + $level = Logger::INFO; + } + $log->pushHandler(new StreamHandler($logFile), $level); + + // Processor + $log->pushProcessor(new IntrospectionProcessor()); + + Zend_Registry::set('logger', $log); + } + /** * Init database */ diff --git a/application/modules/default/controllers/AideController.php b/application/modules/default/controllers/AideController.php index ca027b8a7..721a03bcd 100644 --- a/application/modules/default/controllers/AideController.php +++ b/application/modules/default/controllers/AideController.php @@ -3,8 +3,18 @@ class AideController extends Zend_Controller_Action { protected $theme; + /** + * Logger + * @var \Monolog\Logger + */ + protected $logger; + public function init() { + if (Zend_Registry::isRegistered('logger')) { + $this->logger = Zend_Registry::get('logger'); + } + // --- Theme $this->theme = Zend_Registry::get('theme'); } @@ -70,7 +80,7 @@ class AideController extends Zend_Controller_Action require_once 'Scores/WsScores.php'; $ws = new WsScores(); $accept = $ws->setCGU(); - Zend_Registry::get('firebug')->info($accept); + $this->logger->info($accept); if ($accept) { //Put in session $auth = Zend_Auth::getInstance(); diff --git a/application/modules/default/controllers/AuthController.php b/application/modules/default/controllers/AuthController.php index 4af345f78..966e03173 100644 --- a/application/modules/default/controllers/AuthController.php +++ b/application/modules/default/controllers/AuthController.php @@ -14,8 +14,18 @@ class AuthController extends Zend_Controller_Action ) ); + /** + * Logger + * @var \Monolog\Logger + */ + protected $logger; + public function init() { + if (Zend_Registry::isRegistered('logger')) { + $this->logger = Zend_Registry::get('logger'); + } + // --- Theme $this->theme = Zend_Registry::get('theme'); } @@ -96,7 +106,7 @@ class AuthController extends Zend_Controller_Action try { $ws = new Scores_Ws_Client('gestion', '0.3'); $InfosLogin = $ws->getInfosLogin($parameters); - Zend_Registry::get('firebug')->info($InfosLogin); + $this->logger->info(print_r($InfosLogin,1)); if ( is_string($InfosLogin) || $InfosLogin->error->errnum != 0 ) { $this->view->Error = true; } else { diff --git a/application/modules/default/controllers/BdfController.php b/application/modules/default/controllers/BdfController.php index 14257f7d5..29f1bf7e3 100644 --- a/application/modules/default/controllers/BdfController.php +++ b/application/modules/default/controllers/BdfController.php @@ -3,8 +3,18 @@ class BdfController extends Zend_Controller_Action { protected $theme; + /** + * Logger + * @var \Monolog\Logger + */ + protected $logger; + public function init() { + if (Zend_Registry::isRegistered('logger')) { + $this->logger = Zend_Registry::get('logger'); + } + // --- Theme $this->theme = Zend_Registry::get('theme'); } @@ -83,7 +93,7 @@ class BdfController extends Zend_Controller_Action $req = substr($siret, 0, 9); } - Zend_Registry::get('firebug')->info($module); + $this->logger->info($module); $content = array(); diff --git a/application/modules/default/controllers/DashboardController.php b/application/modules/default/controllers/DashboardController.php index 07001a534..c29638cb5 100644 --- a/application/modules/default/controllers/DashboardController.php +++ b/application/modules/default/controllers/DashboardController.php @@ -101,6 +101,12 @@ class DashboardController extends Zend_Controller_Action 'aUA' => 'ATTESTATION DU CONJOINT COMMUN EN BIENS', ); + /** + * Logger + * @var \Monolog\Logger + */ + protected $logger; + /** * Return a ramdom password * @param int $length @@ -128,6 +134,10 @@ class DashboardController extends Zend_Controller_Action public function init() { + if (Zend_Registry::isRegistered('logger')) { + $this->logger = Zend_Registry::get('logger'); + } + // --- Theme $this->theme = Zend_Registry::get('theme'); @@ -782,7 +792,7 @@ class DashboardController extends Zend_Controller_Action $user = $ws->getUser($login); $options = json_decode($user, true); - Zend_Registry::get('firebug')->info($user); + $this->logger->info(print_r($user,1)); $this->view->assign('droits', explode(' ',$options['droits'])); $this->view->assign('prefs', explode(' ',$options['pref'])); @@ -868,7 +878,7 @@ class DashboardController extends Zend_Controller_Action } } - Zend_Registry::get('firebug')->info($output); + $this->logger->info(print_r($output,1)); $this->view->assign('output', $output); } @@ -983,7 +993,7 @@ class DashboardController extends Zend_Controller_Action //Liste des periodes de facturation $contrats = $ws->getClientTarifs($idClient); - Zend_Registry::get('firebug')->info($contrats); + $this->logger->info(print_r($contrats,1)); $this->view->assign('contrats', $contrats->item); //Liste des services diff --git a/application/modules/default/controllers/DirigeantController.php b/application/modules/default/controllers/DirigeantController.php index 8dc833678..25910f5a1 100644 --- a/application/modules/default/controllers/DirigeantController.php +++ b/application/modules/default/controllers/DirigeantController.php @@ -5,8 +5,18 @@ class DirigeantController extends Zend_Controller_Action protected $siret; protected $id; + /** + * Logger + * @var \Monolog\Logger + */ + protected $logger; + public function init() { + if (Zend_Registry::isRegistered('logger')) { + $this->logger = Zend_Registry::get('logger'); + } + // --- Theme $this->theme = Zend_Registry::get('theme'); diff --git a/application/modules/default/controllers/ErrorController.php b/application/modules/default/controllers/ErrorController.php index b60679658..58e49ddf3 100644 --- a/application/modules/default/controllers/ErrorController.php +++ b/application/modules/default/controllers/ErrorController.php @@ -3,8 +3,18 @@ class ErrorController extends Zend_Controller_Action { protected $theme; + /** + * Logger + * @var \Monolog\Logger + */ + protected $logger; + public function init() { + if (Zend_Registry::isRegistered('logger')) { + $this->logger = Zend_Registry::get('logger'); + } + // --- Theme $this->theme = Zend_Registry::get('theme'); } diff --git a/application/modules/default/controllers/EvaluationController.php b/application/modules/default/controllers/EvaluationController.php index 5b15a4bb8..17749c17b 100644 --- a/application/modules/default/controllers/EvaluationController.php +++ b/application/modules/default/controllers/EvaluationController.php @@ -5,8 +5,18 @@ class EvaluationController extends Zend_Controller_Action protected $siret = null; protected $id = 0; + /** + * Logger + * @var \Monolog\Logger + */ + protected $logger; + public function init() { + if (Zend_Registry::isRegistered('logger')) { + $this->logger = Zend_Registry::get('logger'); + } + // --- Theme $this->theme = Zend_Registry::get('theme'); @@ -455,7 +465,7 @@ class EvaluationController extends Zend_Controller_Action $email = $request->getParam('email', ''); $infos = $ws->getRapport($siren, 3, 0, $plus, $ref, $encours, $email); - Zend_Registry::get('firebug')->info($infos); + $this->logger->info(print_r($infos,1)); if ($infos === false) { $this->forward('soap', 'error'); } diff --git a/application/modules/default/controllers/FinanceController.php b/application/modules/default/controllers/FinanceController.php index a6607e907..6f17ea933 100644 --- a/application/modules/default/controllers/FinanceController.php +++ b/application/modules/default/controllers/FinanceController.php @@ -5,8 +5,18 @@ class FinanceController extends Zend_Controller_Action protected $siret = null; protected $id = 0; + /** + * Logger + * @var \Monolog\Logger + */ + protected $logger; + public function init() { + if (Zend_Registry::isRegistered('logger')) { + $this->logger = Zend_Registry::get('logger'); + } + // --- Theme $this->theme = Zend_Registry::get('theme'); @@ -736,7 +746,7 @@ class FinanceController extends Zend_Controller_Action if ($result === false) { $this->view->msg = "Erreur lors de l'enregistrement des informations"; } else { - Zend_Registry::get('firebug')->info($result); + $this->logger->info(printr_($result,1)); $this->view->ref = strtoupper($result); $this->view->fileref = $params['siren'] . '_' . $params['format'] . '_' . substr($params['dateCloture'],6,4) . substr($params['dateCloture'],3,2) . @@ -1042,10 +1052,10 @@ class FinanceController extends Zend_Controller_Action } else { $infos = $this->getRequest()->getParam('infos'); } - + $user = new Scores_Utilisateur(); $this->view->assign('edition', $user->checkModeEdition()); - + $entreprise = new Scores_Session_Entreprise($this->siret, $this->id); $this->view->assign('banques', $infos->result->item); diff --git a/application/modules/default/controllers/GiantController.php b/application/modules/default/controllers/GiantController.php index 92077d2b2..8f8165a7d 100644 --- a/application/modules/default/controllers/GiantController.php +++ b/application/modules/default/controllers/GiantController.php @@ -40,9 +40,18 @@ class GiantController extends Zend_Controller_Action 'NL' => 'The Netherlands', ); + /** + * Logger + * @var \Monolog\Logger + */ + protected $logger; public function init() { + if (Zend_Registry::isRegistered('logger')) { + $this->logger = Zend_Registry::get('logger'); + } + // --- Theme $this->theme = Zend_Registry::get('theme'); @@ -409,7 +418,7 @@ class GiantController extends Zend_Controller_Action { $this->_helper->layout()->disableLayout(); $this->view->headScript()->appendFile($this->theme->pathScript.'/giant_monitoring.js', 'text/javascript'); - $this->view->headScript()->appendFile$this->theme->pathScript.'/giant.js', 'text/javascript'); + $this->view->headScript()->appendFile($this->theme->pathScript.'/giant.js', 'text/javascript'); $auth = Zend_Auth::getInstance(); $identity = $auth->getIdentity(); $result = $auth->getStorage()->read($identity); diff --git a/application/modules/default/controllers/IdentiteController.php b/application/modules/default/controllers/IdentiteController.php index f4693dfde..83647e030 100644 --- a/application/modules/default/controllers/IdentiteController.php +++ b/application/modules/default/controllers/IdentiteController.php @@ -5,8 +5,18 @@ class IdentiteController extends Zend_Controller_Action protected $siret = null; protected $id = 0; + /** + * Logger + * @var \Monolog\Logger + */ + protected $logger; + public function init() { + if (Zend_Registry::isRegistered('logger')) { + $this->logger = Zend_Registry::get('logger'); + } + // --- Theme $this->theme = Zend_Registry::get('theme'); @@ -455,7 +465,7 @@ class IdentiteController extends Zend_Controller_Action $ws = new WsScores(); $infos = $ws->getEtablissementsGeo($siren, $actif, $position, $nbAffichage); - Zend_Registry::get('firebug')->info($infos); + $this->logger->info(print_r($infos,1)); if ($infos === false) $this->forward('soap', 'error'); $etabs = $infos->result->item; @@ -521,7 +531,7 @@ class IdentiteController extends Zend_Controller_Action 'gps' => $gps, ); } - Zend_Registry::get('firebug')->info($marks); + $this->logger->info(print_r($marks,1)); } $this->view->assign('marks', json_encode($marks)); } @@ -1071,7 +1081,7 @@ class IdentiteController extends Zend_Controller_Action $ws = new WsScores(); $result = $ws->getLienRef($id); - Zend_Registry::get('firebug')->info($result); + $this->logger->info(print_r($result,1)); $this->view->assign('result', $result); $this->view->assign('idFiche', $id); @@ -1487,7 +1497,7 @@ class IdentiteController extends Zend_Controller_Action $result = $ws->getGroupesArbo($siren, $pctMin, 10, $stopAtIsin); if ( $result!==false ) { $infos = json_decode($result, true); - Zend_Registry::get('firebug')->info($infos); + $this->logger->info(print_r($infos,1)); if (count($infos)>0) { $name = $infos['name']; @@ -1535,7 +1545,7 @@ class IdentiteController extends Zend_Controller_Action if ( $result!==false ) { $infos = json_decode($result, true); - Zend_Registry::get('firebug')->info($infos); + $this->logger->info(print_r($infos,1)); if (count($infos)>0) { $sirenTxt = substr($infos['siren'],0,3).' '.substr($infos['siren'],3,3).' '.substr($infos['siren'],6,3); @@ -1652,7 +1662,7 @@ class IdentiteController extends Zend_Controller_Action $ws = new WsScores(); $result = $ws->getContactEt($companyId, $filter); - Zend_Registry::get('firebug')->info($result); + $this->logger->info(print_r($result,1)); if ($result->nbReponses>0) { $this->view->assign('contacts', $result->result->item); @@ -1716,7 +1726,7 @@ class IdentiteController extends Zend_Controller_Action $ws = new WsScores(); $result = $ws->getEntrepriseAvisRncs($siren); - Zend_Registry::get('firebug')->info($result); + $this->logger->info(print_r($result,1)); if ( $result === false ) { $this->view->assign('error', true); @@ -1895,7 +1905,7 @@ class IdentiteController extends Zend_Controller_Action $ws = new WsScores(); $result = $ws->getEntrepriseAvisRncs($siren); - Zend_Registry::get('firebug')->info($result); + $this->logger->info(print_r($result,1)); if ( $result === false ) { $this->view->assign('error', true); diff --git a/application/modules/default/controllers/IndexController.php b/application/modules/default/controllers/IndexController.php index 23ea45dc2..8f189d4ec 100644 --- a/application/modules/default/controllers/IndexController.php +++ b/application/modules/default/controllers/IndexController.php @@ -3,6 +3,19 @@ class IndexController extends Zend_Controller_Action { protected $theme; + /** + * Logger + * @var \Monolog\Logger + */ + protected $logger; + + public function init() + { + if (Zend_Registry::isRegistered('logger')) { + $this->logger = Zend_Registry::get('logger'); + } + } + /** * Page d'accueil et de redirection */ diff --git a/application/modules/default/controllers/JuridiqueController.php b/application/modules/default/controllers/JuridiqueController.php index 8321e20f8..e19178aa5 100644 --- a/application/modules/default/controllers/JuridiqueController.php +++ b/application/modules/default/controllers/JuridiqueController.php @@ -5,8 +5,18 @@ class JuridiqueController extends Zend_Controller_Action protected $siret = null; protected $id = 0; + /** + * Logger + * @var \Monolog\Logger + */ + protected $logger; + public function init() { + if (Zend_Registry::isRegistered('logger')) { + $this->logger = Zend_Registry::get('logger'); + } + // --- Theme $this->theme = Zend_Registry::get('theme'); @@ -83,7 +93,7 @@ class JuridiqueController extends Zend_Controller_Action case 'bomp': $filtre = $request->getParam('filtre', 'A'); $this->view->assign('filtre', $filtre); - Zend_Registry::get('firebug')->info("getAnnoncesBoamp"); + $this->logger->info("getAnnoncesBoamp"); $infos = $ws->getAnnoncesBoamp($siren, $idAnn, $filtre, $position, $nbAffichage); break; case 'bodacc': @@ -98,7 +108,7 @@ class JuridiqueController extends Zend_Controller_Action $infos = $ws->getAnnoncesLegales($siren, $idAnn, null, $position, $nbAffichage); break; } - Zend_Registry::get('firebug')->info($infos); + $this->logger->info(print_r($infos,1)); if ($infos === false) { $this->forward('soap', 'error'); } @@ -159,7 +169,7 @@ class JuridiqueController extends Zend_Controller_Action foreach($objAnnonces->$classType as $ann) { $annonces[] = $objAnnonces->getAnnonceResume($ann); } - Zend_Registry::get('firebug')->info($annonces); + $this->logger->info(print_r($annonces,1)); $this->view->assign('annonces', $annonces); } $this->view->headScript()->appendFile($this->theme->pathScript.'/annonces.js', 'text/javascript'); @@ -235,7 +245,7 @@ class JuridiqueController extends Zend_Controller_Action $infos = $ws->getAnnoncesLegales($siren, $idAnn, null, $position, $nbAffichage); break; } - Zend_Registry::get('firebug')->info($infos); + $this->logger->info(print_r($infos,1)); if ($infos === false) { $this->forward('soap', 'error'); } @@ -264,7 +274,7 @@ class JuridiqueController extends Zend_Controller_Action foreach($objAnnonces->$classType as $ann) { if($ann->id==$idAnn) break; } - Zend_Registry::get('firebug')->info($ann); + $this->logger->info(print_r($ann,1)); $annonce = array( 'Desc' => $objAnnonces->getAnnonceDesc($ann), 'Entree' => $objAnnonces->getAnnonceEntree($ann), @@ -515,7 +525,7 @@ class JuridiqueController extends Zend_Controller_Action if ($infos === false) $this->_forward('soap', 'error'); $competences = $infos->result->item; - Zend_Registry::get('firebug')->info($infos); + $this->logger->info(print_r($infos,1)); if( $type=='tri' || $type=='cfe' ) { $i=0; foreach($competences as $comp){ @@ -550,7 +560,7 @@ class JuridiqueController extends Zend_Controller_Action $ws = new WsScores(); $infos = $ws->getListeConventions($siren); $conventions = $infos->result->item; - Zend_Registry::get('firebug')->info($conventions); + $this->logger->info(print_r($conventions,1)); $this->view->assign('conventions', $conventions); $this->view->assign('exportObjet', $infos); } @@ -580,7 +590,7 @@ class JuridiqueController extends Zend_Controller_Action $this->view->assign('marques', $marques); $this->view->assign('idObject', $idObject); $this->view->assign('exportObjet', $marques); - Zend_Registry::get('firebug')->info($infos); + $this->logger->info(print_r($infos,1)); } /** @@ -604,9 +614,9 @@ class JuridiqueController extends Zend_Controller_Action if(!file_exists($directory.'/'.$file) || filesize($directory.'/'.$file)==0 ) { $cmd = 'php ' . APPLICATION_PATH . '/../scripts/jobs/getMarque.php ' . $numdepot; - Zend_Registry::get('firebug')->info($cmd); + $this->logger->info($cmd); $result = exec($cmd); - Zend_Registry::get('firebug')->info($result); + $this->logger->info($result); } //On vérfie que le fichier existe après le téléchargement if(file_exists($directory.'/'.$file) && filesize($directory.'/'.$file)>0) { @@ -666,7 +676,7 @@ class JuridiqueController extends Zend_Controller_Action $ws = new WsScores(); $result = $ws->getAnnoncesNum($siren); - Zend_Registry::get('firebug')->info($result); + $this->logger->info(print_r($result,1)); $numWS = array(); if (count($result->item)>0) { foreach ($result->item as $item) { diff --git a/application/modules/default/controllers/LogoController.php b/application/modules/default/controllers/LogoController.php index 3fabbf1fa..55132f899 100644 --- a/application/modules/default/controllers/LogoController.php +++ b/application/modules/default/controllers/LogoController.php @@ -4,8 +4,18 @@ class LogoController extends Zend_Controller_Action protected $theme; protected $pathLogo = ''; + /** + * Logger + * @var \Monolog\Logger + */ + protected $logger; + public function init() { + if (Zend_Registry::isRegistered('logger')) { + $this->logger = Zend_Registry::get('logger'); + } + // --- Theme $this->theme = Zend_Registry::get('theme'); diff --git a/application/modules/default/controllers/MandataireController.php b/application/modules/default/controllers/MandataireController.php index c1cf53cb8..3bd250911 100644 --- a/application/modules/default/controllers/MandataireController.php +++ b/application/modules/default/controllers/MandataireController.php @@ -54,8 +54,18 @@ class MandataireController extends Zend_Controller_Action array( "triId"=>"1798", "triCode"=>"AGENL", "triNom"=>"Cour d'Appel d'Agen", "triCP"=>"47916" ), ); + /** + * Logger + * @var \Monolog\Logger + */ + protected $logger; + public function init() { + if (Zend_Registry::isRegistered('logger')) { + $this->logger = Zend_Registry::get('logger'); + } + // --- Theme $this->theme = Zend_Registry::get('theme'); @@ -76,13 +86,13 @@ class MandataireController extends Zend_Controller_Action $ws = new WsScores(); - Zend_Registry::get('firebug')->info('idMandataire : '.$idMandataire); + $this->logger->info('idMandataire : '.$idMandataire); //Mode edition if ($idMandataire != '') { $idMandataire = (int)substr($idMandataire,1); $reponse = $ws->getMandataire($idMandataire); - Zend_Registry::get('firebug')->info($reponse); + $this->logger->info(print_r($reponse,1)); if ($reponse!==false) { $tabMandataires = json_decode($reponse, true); } else { diff --git a/application/modules/default/controllers/OrderController.php b/application/modules/default/controllers/OrderController.php index a50d2d8c4..805308e86 100644 --- a/application/modules/default/controllers/OrderController.php +++ b/application/modules/default/controllers/OrderController.php @@ -3,8 +3,18 @@ class OrderController extends Zend_Controller_Action { protected $theme; + /** + * Logger + * @var \Monolog\Logger + */ + protected $logger; + public function init() { + if (Zend_Registry::isRegistered('logger')) { + $this->logger = Zend_Registry::get('logger'); + } + // --- Theme $this->theme = Zend_Registry::get('theme'); } diff --git a/application/modules/default/controllers/PiecesController.php b/application/modules/default/controllers/PiecesController.php index 8d7bf1472..b347020ac 100644 --- a/application/modules/default/controllers/PiecesController.php +++ b/application/modules/default/controllers/PiecesController.php @@ -18,8 +18,18 @@ class PiecesController extends Zend_Controller_Action protected $siret; protected $id; + /** + * Logger + * @var \Monolog\Logger + */ + protected $logger; + public function init() { + if (Zend_Registry::isRegistered('logger')) { + $this->logger = Zend_Registry::get('logger'); + } + // --- Theme $this->theme = Zend_Registry::get('theme'); @@ -131,7 +141,7 @@ class PiecesController extends Zend_Controller_Action //Affichage des actes disponible $ws = new WsScores(); $responses = $ws->getPiecesActes($siren); - Zend_Registry::get('firebug')->info($responses); + $this->logger->info(print_r($responses,1)); /* * Construire la réponse pour affichage @@ -499,7 +509,7 @@ class PiecesController extends Zend_Controller_Action $this->view->assign('msg', "Erreur lors du téléchargement du fichier."); } } catch (Zend_Http_Client_Exception $e) { - Zend_Registry::get('firebug')->info('HTTP Exception : '.$e->getMessage()); + $this->logger->info('HTTP Exception : '.$e->getMessage()); $this->view->assign('msg', "Erreur lors du téléchargement du fichier."); } } @@ -627,7 +637,7 @@ class PiecesController extends Zend_Controller_Action $this->view->assign('msg', "Erreur lors du téléchargement du fichier."); } } catch (Zend_Http_Client_Exception $e) { - Zend_Registry::get('firebug')->info('HTTP Exception : '.$e->getMessage()); + $this->logger->info('HTTP Exception : '.$e->getMessage()); $this->view->assign('msg', "Erreur lors du téléchargement du fichier."); } } @@ -826,10 +836,10 @@ class PiecesController extends Zend_Controller_Action $params->companyId = $siren; $result = $ws->getAssoActes($params); $actes = array(); - Zend_Registry::get('firebug')->info($result); + $this->logger->info(print_r($result,1)); if (count($result->item) > 0) { foreach ($result->item as $item) { - Zend_Registry::get('firebug')->info($item); + $this->logger->info(print_r($item,1)); if ( $user->checkPerm('actes') ) { $href = $this->view->url(array('controller'=>'pieces', 'action'=>'associationacte', 'siren'=>$siren, 'date'=> $item->Date), 'default', true); @@ -898,7 +908,7 @@ class PiecesController extends Zend_Controller_Action $this->view->assign('msg', "Erreur lors du téléchargement du fichier."); } } catch (Zend_Http_Client_Exception $e) { - Zend_Registry::get('firebug')->info('HTTP Exception : '.$e->getMessage()); + $this->logger->info('HTTP Exception : '.$e->getMessage()); $this->view->assign('msg', "Erreur lors du téléchargement du fichier."); } @@ -926,7 +936,7 @@ class PiecesController extends Zend_Controller_Action $ws = new WsScores(); $reponse = $ws->getPiecesBilans($siren); $listBilans = $reponse->result->item; - Zend_Registry::get('firebug')->info($listBilans); + $this->logger->info(print_r($listBilans,1)); $decision = ''; foreach ( $listBilans as $item) { @@ -1007,7 +1017,7 @@ class PiecesController extends Zend_Controller_Action $this->view->assign('msg', "Erreur lors du téléchargement du fichier."); } } catch (Zend_Http_Client_Exception $e) { - Zend_Registry::get('firebug')->info('HTTP Exception : '.$e->getMessage()); + $this->logger->info('HTTP Exception : '.$e->getMessage()); $this->view->assign('msg', "Erreur lors du téléchargement du fichier."); } diff --git a/application/modules/default/controllers/PrintController.php b/application/modules/default/controllers/PrintController.php index 74dc5493a..66b0fb5db 100644 --- a/application/modules/default/controllers/PrintController.php +++ b/application/modules/default/controllers/PrintController.php @@ -3,8 +3,18 @@ class PrintController extends Zend_Controller_Action { protected $theme; + /** + * Logger + * @var \Monolog\Logger + */ + protected $logger; + public function init() { + if (Zend_Registry::isRegistered('logger')) { + $this->logger = Zend_Registry::get('logger'); + } + // --- Theme $this->theme = Zend_Registry::get('theme'); } @@ -209,7 +219,7 @@ class PrintController extends Zend_Controller_Action } $this->view->assign('controller', $elements['controller']); $this->view->assign('action', $elements['action']); - Zend_Registry::get('firebug')->info($elements['params']); + $this->logger->info(print_r($elements['params'],1)); $this->view->assign('params', $elements['params']); } diff --git a/application/modules/default/controllers/RechercheController.php b/application/modules/default/controllers/RechercheController.php index 5f2385ec5..5549a0bce 100644 --- a/application/modules/default/controllers/RechercheController.php +++ b/application/modules/default/controllers/RechercheController.php @@ -3,8 +3,18 @@ class RechercheController extends Zend_Controller_Action { protected $theme; + /** + * Logger + * @var \Monolog\Logger + */ + protected $logger; + public function init() { + if (Zend_Registry::isRegistered('logger')) { + $this->logger = Zend_Registry::get('logger'); + } + // --- Theme $this->theme = Zend_Registry::get('theme'); @@ -286,7 +296,7 @@ class RechercheController extends Zend_Controller_Action $request = $this->getRequest(); if ($request->isPost() && $form->isValid($request->getParams())) { - Zend_Registry::get('firebug')->info($form->getValues()); + $this->logger->info(print_r($form->getValues(),1)); $c = Zend_Registry::get('config'); $path = $c->profil->path->shared.'/persist/log'; @@ -399,7 +409,7 @@ class RechercheController extends Zend_Controller_Action //Giant if( !empty($params['pays']) && $type == 'ent' ){ - Zend_Registry::get('firebug')->info('RECHERCHE GIANT'); + $this->logger->info('RECHERCHE GIANT'); $this->_forward('search', 'giant', null, $params); //Worldcheck } elseif ($type == 'wcheck' ) { @@ -917,7 +927,7 @@ class RechercheController extends Zend_Controller_Action $sql->where("LOWER(libelle) ".$where); } } - Zend_Registry::get('firebug')->info($where); + $this->logger->info($where); $rows = $table->fetchAll($sql); if ( count($rows)>0 ) { diff --git a/application/modules/default/controllers/SaisieController.php b/application/modules/default/controllers/SaisieController.php index 2a57c550b..f43e278fb 100644 --- a/application/modules/default/controllers/SaisieController.php +++ b/application/modules/default/controllers/SaisieController.php @@ -230,10 +230,6 @@ class SaisieController extends Zend_Controller_Action * Genre * @var array */ - /** - * civilité en dur - * @todo verifier si liste à jour civilité - */ protected $selectGenre = array( '' => '-', 'M.' => 'M', @@ -242,8 +238,18 @@ class SaisieController extends Zend_Controller_Action 'Societe' => 'STE' ); + /** + * Logger + * @var \Monolog\Logger + */ + protected $logger; + public function init() { + if (Zend_Registry::isRegistered('logger')) { + $this->logger = Zend_Registry::get('logger'); + } + // --- Theme $this->theme = Zend_Registry::get('theme'); @@ -550,7 +556,7 @@ class SaisieController extends Zend_Controller_Action $ws = new WsScores(); $reponse = $ws->getListeEtablissements($siren, -1, 0, 100); $listeEtablissements = $reponse->result->item; - //Zend_Registry::get('firebug')->info(count($listeEtablissements)); + //$this->logger->info(count($listeEtablissements)); $this->view->assign('ListeEtablissements', $listeEtablissements); //Assign constantes $this->view->assign('selectDir', $selectDir); @@ -939,7 +945,7 @@ class SaisieController extends Zend_Controller_Action // --- Selection des valeurs du bilan en cours if ( null !== $milDate ) { - Zend_Registry::get('firebug')->info('milDate'); + $this->logger->info('milDate'); $response = $ws->getBilan($siren, $milDate, $type, true); $infos = new stdClass(); $infos->siren = $response->siren; @@ -955,9 +961,9 @@ class SaisieController extends Zend_Controller_Action } // --- Selection des valeurs du bilan précédent pour remplir la colonne N-1 elseif ( null === $milDate && null !== $milDatePre ) { - Zend_Registry::get('firebug')->info('milDatePre'); + $this->logger->info('milDatePre'); $response = $ws->getBilan($siren, $milDatePre, $type, true); - Zend_Registry::get('firebug')->info($response); + $this->logger->info($response); $infos = new stdClass(); $infos->siren = $response->siren; $infos->dateCloturePre = $response->DATE_CLOTURE; @@ -1352,13 +1358,13 @@ class SaisieController extends Zend_Controller_Action $params['step'] ); - Zend_Registry::get('firebug')->info($response); + $this->logger->info(print_r($response,1)); if (is_int($response)) { $this->view->assign('result', array('status'=>'OK')); } else { if ( preg_match_all('/([A-Z0-9]{2,});?/', $response, $postes) ) { - Zend_Registry::get('firebug')->info($postes[1]); + $this->logger->info($postes[1]); $this->view->assign('result', array( 'status'=>'ERR', 'message'=>'Erreur valeur', @@ -1390,7 +1396,7 @@ class SaisieController extends Zend_Controller_Action $ws = new WsScores(); - Zend_Registry::get('firebug')->info('createfiche:'.$createFiche); + $this->logger->info('createfiche:'.$createFiche); $id2 = null; @@ -1432,16 +1438,16 @@ class SaisieController extends Zend_Controller_Action ); $id2 = $ws->setLienRef(json_encode($infos)); if (is_int($id2)) { - Zend_Registry::get('firebug')->info('id2:'.$id2); + $this->logger->info('id2:'.$id2); $this->view->assign('id2', $id2); $this->view->assign('id2Nom', $result->Nom); } } if ( $lienRef !== null ) { - Zend_Registry::get('firebug')->info('lienRef:'.$lienRef); + $this->logger->info('lienRef:'.$lienRef); $result = $ws->getLienRef($lienRef); - Zend_Registry::get('firebug')->info($result); + $this->logger->info(print_r($result,1)); $rs = $result->raisonSociale; //Override session session if ( intval($result->siren) != 0 ) { @@ -1478,7 +1484,7 @@ class SaisieController extends Zend_Controller_Action $result = $ws->getSaisieLien($idLien); $infos = json_decode($result, true); - Zend_Registry::get('firebug')->info($infos); + $this->logger->info(print_r($infos,1)); if ($type=='actionnaire') { $this->view->assign('id1', $infos['idPar']); @@ -1519,7 +1525,7 @@ class SaisieController extends Zend_Controller_Action $result = $ws->getSaisieLien($idLien); $infos = json_decode($result, true); - Zend_Registry::get('firebug')->info($infos); + $this->logger->info(print_r($infos,1)); if ($type=='actionnaire') { $this->view->assign('id1', $infos['idPar']); @@ -1590,7 +1596,7 @@ class SaisieController extends Zend_Controller_Action 'idLoc3Num' => '', ); $idNewLien = $ws->setLienRef(json_encode($infos)); - Zend_Registry::get('firebug')->info('idNewLien:'.$idNewLien); + $this->logger->info('idNewLien:'.$idNewLien); if ( is_int($idNewLien) ) { $this->view->assign('id1', $idNewLien); } @@ -1621,7 +1627,7 @@ class SaisieController extends Zend_Controller_Action $ws = new WsScores(); $result = $ws->searchLienRef($query, $type); - Zend_Registry::get('firebug')->info($result); + $this->logger->info(print_r($result,1)); $output = array(); if (count($result->item)>0) { foreach ($result->item as $item) { @@ -1644,7 +1650,7 @@ class SaisieController extends Zend_Controller_Action $mode = $request->getParam('mode', null); $this->view->assign('mode', $mode); - Zend_Registry::get('firebug')->info($mode); + $this->logger->info($mode); if ($mode === null) { $this->_helper->layout()->disableLayout(); @@ -1799,7 +1805,7 @@ class SaisieController extends Zend_Controller_Action 'bilEE' => $params['bilEE'], ); - Zend_Registry::get('firebug')->info($params); + $this->logger->info(print_r($params,1)); $ws = new WsScores(); $idNewLien = $ws->setLienRef(json_encode($infos), $params['idLien']); @@ -1874,7 +1880,7 @@ class SaisieController extends Zend_Controller_Action } } } - Zend_Registry::get('firebug')->info($infos); + $this->logger->info(print_r($infos,1)); $idNewLien = $ws->setLien(json_encode($infos), $params['idLien']); @@ -2137,7 +2143,7 @@ class SaisieController extends Zend_Controller_Action $ws = new WsScores(); $result = $ws->getIdentite($siren); - Zend_Registry::get('firebug')->info($result); + $this->logger->info(print_r($result,1)); $this->view->assign('nom',$result->Nom); $this->view->assign('sigle',$result->sigle); @@ -2208,8 +2214,8 @@ class SaisieController extends Zend_Controller_Action $items = json_decode($result, true); if ( $items!==null ) { - Zend_Registry::get('firebug')->info('getSaisieLienRef id='.$id); - Zend_Registry::get('firebug')->info($items); + $this->logger->info('getSaisieLienRef id='.$id); + $this->logger->info(print_r($items,1)); //Get country code if ($items->adresse_pays!='FRA') { @@ -2217,8 +2223,6 @@ class SaisieController extends Zend_Controller_Action $this->view->assign('identifiant', $result->item); } - Zend_Registry::get('firebug')->info($items); - if (count($items)>0) { foreach( $items as $key => $val ) { switch ($key) { @@ -2342,7 +2346,7 @@ class SaisieController extends Zend_Controller_Action $result = $ws->setLienRef(json_encode($infos), $id); $message = ($result == 1)?'Fiche supprimée':'Erreur de suppression'; } - Zend_Registry::get('firebug')->info($checkLiens->participations->item); + $this->logger->info($checkLiens->participations->item); $this->view->assign('message', $message); } } else { @@ -2709,7 +2713,7 @@ class SaisieController extends Zend_Controller_Action $ws = new WsScores(); $result = $ws->getSaisieContactEt($id); $data = json_decode($result, true); - Zend_Registry::get('firebug')->info($data); + $this->logger->info(print_r($data,1)); $this->view->assign('id', $data['id']); $this->view->assign('siret', str_pad($data['siren'],9,'0',STR_PAD_LEFT).str_pad($data['nic'],5,'0',STR_PAD_LEFT)); $this->view->assign('type', $data['typeTel']); @@ -2866,7 +2870,7 @@ class SaisieController extends Zend_Controller_Action if ( $request->isXmlHttpRequest() ) { $this->_helper->layout()->disableLayout(); } - Zend_Registry::get('firebug')->info($request->getParams()); + $this->logger->info(print_r($request->getParams(),1)); $mode = $request->getParam('mode'); // --- Diplay form to re-validate geocode diff --git a/application/modules/default/controllers/SurveillanceController.php b/application/modules/default/controllers/SurveillanceController.php index 75707140a..cdd08d60c 100644 --- a/application/modules/default/controllers/SurveillanceController.php +++ b/application/modules/default/controllers/SurveillanceController.php @@ -35,8 +35,18 @@ class SurveillanceController extends Zend_Controller_Action 'liens' => 'survliens', ); + /** + * Logger + * @var \Monolog\Logger + */ + protected $logger; + public function init() { + if (Zend_Registry::isRegistered('logger')) { + $this->logger = Zend_Registry::get('logger'); + } + // --- Theme $this->theme = Zend_Registry::get('theme'); @@ -239,7 +249,7 @@ class SurveillanceController extends Zend_Controller_Action $filtre->detail = false; $infos = $ws->getSurveillances($filtre); - Zend_Registry::get('firebug')->info($infos); + $this->logger->info(print_r($infos,1)); if (property_exists($infos->result, 'item') && count($infos->result->item)>0) { $titre = 'Ajouter une surveillance'; diff --git a/application/modules/default/controllers/TelechargementController.php b/application/modules/default/controllers/TelechargementController.php index 11d3ef3c1..fb79b36be 100644 --- a/application/modules/default/controllers/TelechargementController.php +++ b/application/modules/default/controllers/TelechargementController.php @@ -13,9 +13,19 @@ class TelechargementController extends Zend_Controller_Action */ protected $path = ''; + /** + * Logger + * @var \Monolog\Logger + */ + protected $logger; + public function init() { - $this->_helper->layout()->disableLayout(); + if (Zend_Registry::isRegistered('logger')) { + $this->logger = Zend_Registry::get('logger'); + } + + $this->_helper->layout()->disableLayout(); $this->_helper->viewRenderer->setNoRender(true); $c = Zend_Registry::get('config'); @@ -258,7 +268,7 @@ class TelechargementController extends Zend_Controller_Action $authinfo = '/login/'.$identity->username.'/hach/'.$identity->password; $url = $host.$authinfo.'/q/'.$q; - Zend_Registry::get('firebug')->info($url); + $this->logger->info($url); $file = $this->getFile($url, uniqid('histo-').'.pdf'); @@ -301,9 +311,9 @@ class TelechargementController extends Zend_Controller_Action //Téléchargement if( $url !== false) { - Zend_Registry::get('firebug')->info($url); + $this->logger->info($url); $file = $this->getFile($url); - Zend_Registry::get('firebug')->info('File:'.$this->path.'/'.$file); + $this->logger->info('File:'.$this->path.'/'.$file); // --- En attente if ( $file === null ) { echo ''; diff --git a/application/modules/default/controllers/UserController.php b/application/modules/default/controllers/UserController.php index 3c1633388..b62ec9609 100644 --- a/application/modules/default/controllers/UserController.php +++ b/application/modules/default/controllers/UserController.php @@ -28,8 +28,18 @@ class UserController extends Zend_Controller_Action return $new_password; } + /** + * Logger + * @var \Monolog\Logger + */ + protected $logger; + public function init() { + if (Zend_Registry::isRegistered('logger')) { + $this->logger = Zend_Registry::get('logger'); + } + // --- Theme $this->theme = Zend_Registry::get('theme'); @@ -91,10 +101,10 @@ class UserController extends Zend_Controller_Action $options['profil'] = 'Utilisateur'; } $ws = new WsScores(); - Zend_Registry::get('firebug')->info('setInfosLogin'); - Zend_Registry::get('firebug')->info($options); + $this->logger->info('setInfosLogin'); + $this->logger->info(print_r($options,1)); $reponse = $ws->setInfosLogin($login, $action, $options); - Zend_Registry::get('firebug')->info($response); + $this->logger->info(print_r($response,1)); $isProfilUpdated = true; $message = 'Erreur lors de la mise à jour du compte !'; @@ -477,7 +487,7 @@ class UserController extends Zend_Controller_Action //Auth error else { $this->view->message = ''; - Zend_Registry::get('firebug')->info($result); + $this->logger->info(print_r($result)); foreach ($result->getMessages() as $message) { $this->view->message.= $message."
"; } @@ -486,7 +496,7 @@ class UserController extends Zend_Controller_Action } // Pas de validation du formulaire else { - Zend_Registry::get('firebug')->info('DISPLAY'); + $this->logger->info('DISPLAY'); } } diff --git a/application/modules/default/controllers/WorldcheckController.php b/application/modules/default/controllers/WorldcheckController.php index 1ccce3554..9ecc40732 100644 --- a/application/modules/default/controllers/WorldcheckController.php +++ b/application/modules/default/controllers/WorldcheckController.php @@ -4,8 +4,18 @@ class WorldcheckController extends Zend_Controller_Action protected $theme; protected $wcConfig; + /** + * Logger + * @var \Monolog\Logger + */ + protected $logger; + public function init() { + if (Zend_Registry::isRegistered('logger')) { + $this->logger = Zend_Registry::get('logger'); + } + // --- Theme $this->theme = Zend_Registry::get('theme'); diff --git a/composer.json b/composer.json index 486ed46fa..cbc35dfd5 100644 --- a/composer.json +++ b/composer.json @@ -7,7 +7,8 @@ "spipu/html2pdf": "^4.6", "setasign/fpdi": "^1.6", "cybermonde/odtphp": "^1.7", - "fabpot/goutte": "^3.2" + "fabpot/goutte": "^3.2", + "monolog/monolog": "^1.22" }, "require-dev": { "ccampbell/chromephp": "^4.1" diff --git a/composer.lock b/composer.lock index 133d313c2..8b18c2865 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "a5c564ae11b76baad05fe73b3b809099", + "content-hash": "6c57b3ee229a68f4d482e680536a8f55", "packages": [ { "name": "cybermonde/odtphp", @@ -261,6 +261,84 @@ ], "time": "2016-06-24T23:00:38+00:00" }, + { + "name": "monolog/monolog", + "version": "1.22.0", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/monolog.git", + "reference": "bad29cb8d18ab0315e6c477751418a82c850d558" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/bad29cb8d18ab0315e6c477751418a82c850d558", + "reference": "bad29cb8d18ab0315e6c477751418a82c850d558", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "psr/log": "~1.0" + }, + "provide": { + "psr/log-implementation": "1.0.0" + }, + "require-dev": { + "aws/aws-sdk-php": "^2.4.9 || ^3.0", + "doctrine/couchdb": "~1.0@dev", + "graylog2/gelf-php": "~1.0", + "jakub-onderka/php-parallel-lint": "0.9", + "php-amqplib/php-amqplib": "~2.4", + "php-console/php-console": "^3.1.3", + "phpunit/phpunit": "~4.5", + "phpunit/phpunit-mock-objects": "2.3.0", + "ruflin/elastica": ">=0.90 <3.0", + "sentry/sentry": "^0.13", + "swiftmailer/swiftmailer": "~5.3" + }, + "suggest": { + "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", + "doctrine/couchdb": "Allow sending log messages to a CouchDB server", + "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", + "ext-mongo": "Allow sending log messages to a MongoDB server", + "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", + "mongodb/mongodb": "Allow sending log messages to a MongoDB server via PHP Driver", + "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", + "php-console/php-console": "Allow sending log messages to Google Chrome", + "rollbar/rollbar": "Allow sending log messages to Rollbar", + "ruflin/elastica": "Allow sending log messages to an Elastic Search server", + "sentry/sentry": "Allow sending log messages to a Sentry server" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Monolog\\": "src/Monolog" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "Sends your logs to files, sockets, inboxes, databases and various web services", + "homepage": "http://github.com/Seldaek/monolog", + "keywords": [ + "log", + "logging", + "psr-3" + ], + "time": "2016-11-26T00:15:39+00:00" + }, { "name": "phpoffice/phpexcel", "version": "1.8.0", @@ -368,6 +446,53 @@ ], "time": "2016-08-06T14:39:51+00:00" }, + { + "name": "psr/log", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2016-10-10T12:19:37+00:00" + }, { "name": "setasign/fpdi", "version": "1.6.1", diff --git a/library/Application/Controller/Plugin/Auth.php b/library/Application/Controller/Plugin/Auth.php index 7cd63ed5c..5153d1f92 100644 --- a/library/Application/Controller/Plugin/Auth.php +++ b/library/Application/Controller/Plugin/Auth.php @@ -1,9 +1,19 @@ info('PLUGIN AUTH - START'); + if (Zend_Registry::isRegistered('logger')) { + $logger = Zend_Registry::get('logger'); + } + + $logger->info('PLUGIN AUTH - START'); $module = $request->getModuleName(); $controller = $request->getControllerName(); @@ -49,7 +59,7 @@ class Application_Controller_Plugin_Auth extends Zend_Controller_Plugin_Abstract // --- On vérifie le tout lors d'une connexion par url if ( !empty($login) && !empty($hach) ) { - Zend_Registry::get('firebug')->info('AUTH : IPONLY'); + $logger->info('AUTH : IPONLY'); // --- Mode hach if ($mode === null) { @@ -169,6 +179,6 @@ class Application_Controller_Plugin_Auth extends Zend_Controller_Plugin_Abstract } } - Zend_Registry::get('firebug')->info('PLUGIN AUTH - END'); + $logger->info('PLUGIN AUTH - END'); } } \ No newline at end of file diff --git a/library/Application/Controller/Plugin/Cgu.php b/library/Application/Controller/Plugin/Cgu.php index f63d32c96..028498f95 100644 --- a/library/Application/Controller/Plugin/Cgu.php +++ b/library/Application/Controller/Plugin/Cgu.php @@ -9,7 +9,11 @@ class Application_Controller_Plugin_Cgu extends Zend_Controller_Plugin_Abstract */ public function preDispatch(Zend_Controller_Request_Abstract $request) { - Zend_Registry::get('firebug')->info('PLUGIN CGU - START'); + if (Zend_Registry::isRegistered('logger')) { + $logger = Zend_Registry::get('logger'); + } + + $logger->info('PLUGIN CGU - START'); $layout = Zend_Layout::getMVCInstance(); if ($layout->isEnabled()) { @@ -57,6 +61,6 @@ class Application_Controller_Plugin_Cgu extends Zend_Controller_Plugin_Abstract break; } } - Zend_Registry::get('firebug')->info('PLUGIN CGU - END'); + $logger->info('PLUGIN CGU - END'); } } \ No newline at end of file diff --git a/library/Application/Controller/Plugin/Lang.php b/library/Application/Controller/Plugin/Lang.php index d3026acc7..b7cb4e589 100644 --- a/library/Application/Controller/Plugin/Lang.php +++ b/library/Application/Controller/Plugin/Lang.php @@ -9,7 +9,11 @@ class Application_Controller_Plugin_Lang extends Zend_Controller_Plugin_Abstract */ public function preDispatch(Zend_Controller_Request_Abstract $request) { - Zend_Registry::get('firebug')->info('PLUGIN LANG - START'); + if (Zend_Registry::isRegistered('logger')) { + $logger = Zend_Registry::get('logger'); + } + + $logger->info('PLUGIN LANG - START'); $auth = Zend_Auth::getInstance(); if ( $auth->hasIdentity() ) { @@ -56,6 +60,6 @@ class Application_Controller_Plugin_Lang extends Zend_Controller_Plugin_Abstract $registry->set('Zend_Locale', $locale); $registry->set('Zend_Translate', $translate); - Zend_Registry::get('firebug')->info('PLUGIN LANG - END'); + $logger->info('PLUGIN LANG - END'); } } \ No newline at end of file diff --git a/library/Application/Controller/Plugin/Menu.php b/library/Application/Controller/Plugin/Menu.php index 679929600..28373866d 100644 --- a/library/Application/Controller/Plugin/Menu.php +++ b/library/Application/Controller/Plugin/Menu.php @@ -7,7 +7,11 @@ class Application_Controller_Plugin_Menu extends Zend_Controller_Plugin_Abstract */ public function preDispatch(Zend_Controller_Request_Abstract $request) { - Zend_Registry::get('firebug')->info('PLUGIN MENU - START'); + if (Zend_Registry::isRegistered('logger')) { + $logger = Zend_Registry::get('logger'); + } + + $logger->info('PLUGIN MENU - START'); $layout = Zend_Layout::getMVCInstance(); $user = new Scores_Utilisateur(); @@ -80,6 +84,6 @@ class Application_Controller_Plugin_Menu extends Zend_Controller_Plugin_Abstract //$view->aide = true; } - Zend_Registry::get('firebug')->info('PLUGIN MENU - END'); + $logger->info('PLUGIN MENU - END'); } } \ No newline at end of file diff --git a/library/Application/Controller/Plugin/Pdf.php b/library/Application/Controller/Plugin/Pdf.php index 6fd10cab3..7e8e342a4 100644 --- a/library/Application/Controller/Plugin/Pdf.php +++ b/library/Application/Controller/Plugin/Pdf.php @@ -3,7 +3,11 @@ class Application_Controller_Plugin_Pdf extends Zend_Controller_Plugin_Abstract { public function dispatchLoopShutdown() { - Zend_Registry::get('firebug')->info('PLUGIN PDF - START'); + if (Zend_Registry::isRegistered('logger')) { + $logger = Zend_Registry::get('logger'); + } + + $logger->info('PLUGIN PDF - START'); $layout = Zend_Layout::getMVCInstance(); if ($layout->isEnabled()) { @@ -21,6 +25,6 @@ class Application_Controller_Plugin_Pdf extends Zend_Controller_Plugin_Abstract } } - Zend_Registry::get('firebug')->info('PLUGIN PDF - END'); + $logger->info('PLUGIN PDF - END'); } } \ No newline at end of file diff --git a/library/Application/Controller/Plugin/Theme.php b/library/Application/Controller/Plugin/Theme.php index 91c0d2152..c9ee12244 100644 --- a/library/Application/Controller/Plugin/Theme.php +++ b/library/Application/Controller/Plugin/Theme.php @@ -3,7 +3,11 @@ class Application_Controller_Plugin_Theme extends Zend_Controller_Plugin_Abstrac { public function preDispatch(Zend_Controller_Request_Abstract $request) { - Zend_Registry::get('firebug')->info('PLUGIN THEME - START'); + if (Zend_Registry::isRegistered('logger')) { + $logger = Zend_Registry::get('logger'); + } + + $logger->info('PLUGIN THEME - START'); $auth = Zend_Auth::getInstance(); $theme = 'default'; //$theme = 'mobile'; @@ -129,6 +133,6 @@ class Application_Controller_Plugin_Theme extends Zend_Controller_Plugin_Abstrac break; } - Zend_Registry::get('firebug')->info('PLUGIN THEME - STOP'); + $logger->info('PLUGIN THEME - STOP'); } } \ No newline at end of file diff --git a/library/Application/Controller/Plugin/Xml.php b/library/Application/Controller/Plugin/Xml.php index c28bc213b..13927691d 100644 --- a/library/Application/Controller/Plugin/Xml.php +++ b/library/Application/Controller/Plugin/Xml.php @@ -3,7 +3,11 @@ class Application_Controller_Plugin_Xml extends Zend_Controller_Plugin_Abstract { public function dispatchLoopShutdown() { - Zend_Registry::get('firebug')->info('PLUGIN XML - START'); + if (Zend_Registry::isRegistered('logger')) { + $logger = Zend_Registry::get('logger'); + } + + $logger->info('PLUGIN XML - START'); $layout = Zend_Layout::getMVCInstance(); if ($layout->isEnabled()) { @@ -20,6 +24,6 @@ class Application_Controller_Plugin_Xml extends Zend_Controller_Plugin_Abstract } } - Zend_Registry::get('firebug')->info('PLUGIN XML - END'); + $logger->info('PLUGIN XML - END'); } } \ No newline at end of file diff --git a/library/Infogreffe/Infogreffe.php b/library/Infogreffe/Infogreffe.php index 7bb67986c..07a39bdb3 100644 --- a/library/Infogreffe/Infogreffe.php +++ b/library/Infogreffe/Infogreffe.php @@ -547,7 +547,7 @@ class Infogreffe $bilan['mode_diffusion'][] = $mode->getAttribute('type'); } - Zend_Registry::get('firebug')->info('Bilan : '.$bilan['date_cloture'].' '.$bilan['type_comptes']); + $this->logger->info('Bilan : '.$bilan['date_cloture'].' '.$bilan['type_comptes']); //Génération de l'index pour le tri $date = $bilan['date_cloture_iso']; @@ -628,17 +628,17 @@ class Infogreffe ->where('date=?', $date) ->where('num=?', $acte['num_acte']) ->where('file LIKE "acte-'.$siren.'-%-'.$date.'-%-'.$depot['num_depot'].'-'.$acte['num_acte'].'.pdf"'); - Zend_Registry::get('firebug')->info('Detect fichier : '.$sql->__toString()); + $this->logger->info('Detect fichier : '.$sql->__toString()); $result = $actesM->fetchRow($sql); if ( null !== $result ) { - Zend_Registry::get('firebug')->info($result); + $this->logger->info(print_r($result,1)); $fichier = $this->pathData.$this->actePath($ref).$result->file; - Zend_Registry::get('firebug')->info($fichier); + $this->logger->info($fichier); if ( file_exists($fichier) ) { - Zend_Registry::get('firebug')->info($acte); + $this->logger->info(print_r($acte,1)); if ($result->type != $acte['type_acte'] && $result->type2 == '') { - Zend_Registry::get('firebug')->info('Update Database'); + $this->logger->info('Update Database'); //Add to the database try { $actesM->update(array( @@ -648,7 +648,7 @@ class Infogreffe 'date_depot' => $dateDepot->toString('yyyyMMdd') ), 'id='.$result->id); } catch (Zend_Exception $e) { - Zend_Registry::get('firebug')->info($e->getMessage()); + $this->logger->info($e->getMessage()); } } else { try { @@ -658,7 +658,7 @@ class Infogreffe 'date_depot' => $dateDepot->toString('yyyyMMdd') ), 'id='.$result->id); } catch (Zend_Exception $e) { - Zend_Registry::get('firebug')->info($e->getMessage()); + $this->logger->info($e->getMessage()); } } $ref = str_replace('.pdf', '',substr($result->file,15)); @@ -770,7 +770,7 @@ class Infogreffe //Cas de fichier correspondant à la référence $fichier = $this->pathData.$this->bilanPath($ref).$this->bilanFilename($siren,$ref); - Zend_Registry::get('firebug')->info('Fichier : '.$fichier); + $this->logger->info('Fichier : '.$fichier); if( file_exists($fichier) && filesize($fichier)>0 ) { $mode = 'fichier'; diff --git a/library/Scores/Auth/Adapter/Ws.php b/library/Scores/Auth/Adapter/Ws.php index 557fd1f6c..b1b079b57 100644 --- a/library/Scores/Auth/Adapter/Ws.php +++ b/library/Scores/Auth/Adapter/Ws.php @@ -39,6 +39,12 @@ class Scores_Auth_Adapter_Ws implements Zend_Auth_Adapter_Interface '62.210.222.34', ); + /** + * Logger + * @var \Monolog\Logger + */ + protected $logger; + /** * Authentification par WS * @param string $username @@ -62,6 +68,10 @@ class Scores_Auth_Adapter_Ws implements Zend_Auth_Adapter_Interface $this->_password = 'iponly:'.$ip; $this->_checkIp = true; } + + if (Zend_Registry::isRegistered('logger')) { + $this->logger = Zend_Registry::get('logger'); + } } /** @@ -85,8 +95,8 @@ class Scores_Auth_Adapter_Ws implements Zend_Auth_Adapter_Interface $parameters->from = 'auth'; $InfosLogin = $ws->getInfosLogin($parameters); - Zend_Registry::get('firebug')->info(__CLASS__ . ' : '.__METHOD__); - Zend_Registry::get('firebug')->info($InfosLogin); + $this->logger->info(__CLASS__ . ' : '.__METHOD__); + $this->logger->info(print_r($InfosLogin,1)); // --- Renvoi if ( is_string($InfosLogin) || $InfosLogin->error->errnum != 0 ) { $message = $InfosLogin; @@ -96,12 +106,12 @@ class Scores_Auth_Adapter_Ws implements Zend_Auth_Adapter_Interface elseif ( $InfosLogin !== false && !empty($InfosLogin->result->login)) { $identity = new stdClass(); if ($this->_checkIp || $this->_checkHach) { - Zend_Registry::get('firebug')->info("IN"); + $this->logger->info("IN"); $identity->password = $this->_password; } else { $identity->password = md5($InfosLogin->result->login.'|'.$this->_password); } - Zend_Registry::get('firebug')->info($identity->password); + $this->logger->info($identity->password); $identity->username = $InfosLogin->result->login; $identity->email = $InfosLogin->result->email; $identity->profil = $InfosLogin->result->profil; diff --git a/library/Scores/Google/Streetview.php b/library/Scores/Google/Streetview.php index d9a35a342..d104dcaf9 100644 --- a/library/Scores/Google/Streetview.php +++ b/library/Scores/Google/Streetview.php @@ -211,12 +211,12 @@ class Scores_Google_Streetview $response = $client->request('GET'); if ( $response->isSuccessful() ) { if (!copy($response->getStreamName(), $this->pathImg())) { - Zend_Registry::get('firebug')->info('Erreur copie image !'); + $this->logger->info('Erreur copie image !'); return false; } } } catch (Zend_Http_Client_Exception $e) { - Zend_Registry::get('firebug')->info('HTTP Exception : '.$e->getMessage()); + $this->logger->info('HTTP Exception : '.$e->getMessage()); return false; } } diff --git a/library/Scores/IdentiteProcol.php b/library/Scores/IdentiteProcol.php index d683ccbd7..91457d156 100644 --- a/library/Scores/IdentiteProcol.php +++ b/library/Scores/IdentiteProcol.php @@ -5,6 +5,12 @@ class IdentiteProcol protected $annonces = array(); protected $procol; + /** + * Logger + * @var \Monolog\Logger + */ + protected $logger; + /** * Construit l'identite entreprise afin de retourner les éléments formatter * pour l'affichage @@ -13,7 +19,11 @@ class IdentiteProcol */ public function __construct($infos) { - $this->identite = $infos->Identite; + if (Zend_Registry::isRegistered('logger')) { + $this->logger = Zend_Registry::get('logger'); + } + + $this->identite = $infos->Identite; $this->procol = new stdClass(); $this->procol->LibTypeEtab = $infos->LibTypeEtab; $this->procol->StatutsConstDepot = $infos->StatutsConstDepot; @@ -39,7 +49,7 @@ class IdentiteProcol } } } - Zend_Registry::get('firebug')->info($this->annonces); + $this->logger->info(print_r($this->annonces,1)); $this->view = new Zend_View(); } diff --git a/library/Scores/RapportComment.php b/library/Scores/RapportComment.php index 97519d8cf..a8e047350 100644 --- a/library/Scores/RapportComment.php +++ b/library/Scores/RapportComment.php @@ -18,8 +18,18 @@ class RapportComment protected $graphCouleurs = array(); protected $pathImage = ''; + /** + * Logger + * @var \Monolog\Logger + */ + protected $logger; + public function __construct($siret, $id, $tabCommentaires = array(), $RatiosInfos = null, $BilansInfos = null, $RatiosSecteur = null, $tabProjection = array()) { + if (Zend_Registry::isRegistered('logger')) { + $this->logger = Zend_Registry::get('logger'); + } + //Assignation $this->commentaires = $tabCommentaires; $c = Zend_Registry::get('config'); @@ -307,12 +317,12 @@ class RapportComment $pattern = '/COULEUR\((.*)\)/i'; ///Detection couleur if ( preg_match($pattern, $content, $matches) ) { - Zend_Registry::get('firebug')->info('DETECTION Couleurs'); + $this->logger->info('DETECTION Couleurs'); $listeCouleurs = $matches[1]; //Récupération des couleurs $pattern = '/([a-z0-9]{3,4})/i'; if ( preg_match_all($pattern, $listeCouleurs, $matches) ) { - Zend_Registry::get('firebug')->info($matches); + $this->logger->info(print_r($matches,1)); $nbCouleurs = count($matches[1]); for($i=0;$i<$nbCouleurs;$i++){ $this->graphCouleurs[] = $assocNomCouleurs[$matches[1][$i]]; @@ -327,7 +337,7 @@ class RapportComment { $pattern = '/\[GRAPHIQUE id=(.*?) titre=\'(.*?)\',(.*)\]/'; if( preg_match($pattern, $content, $matches) ){ - Zend_Registry::get('firebug')->info($content); + $this->logger->info($content); $image_id = $matches[1]; $titre = $matches[2]; //Génération id/nom fichier graphique @@ -352,7 +362,7 @@ class RapportComment } } - Zend_Registry::get('firebug')->info('Graphique : '.$type); + $this->logger->info('Graphique : '.$type); switch($detectType){ case 'histo': @@ -494,10 +504,10 @@ class RapportComment if( $this->cache_graph($this->pathImage.$file) ){ $output = $file; } else { - Zend_Registry::get('firebug')->info('Histo - id : '.$id); - Zend_Registry::get('firebug')->info('Histo - titre : '.$titre); - Zend_Registry::get('firebug')->info('Histo - strRatios : '.$strRatios); - Zend_Registry::get('firebug')->info($this->ratiosEntrep); + $this->logger->info('Histo - id : '.$id); + $this->logger->info('Histo - titre : '.$titre); + $this->logger->info('Histo - strRatios : '.$strRatios); + $this->logger->info(print_r($this->ratiosEntrep,1)); // --- Gestion des couleurs if(count($this->graphCouleurs)>0){ $couleurs = $this->graphCouleurs; @@ -574,7 +584,7 @@ class RapportComment } } if ( !isset($unite) ) { $unite = 'EUR'; } - Zend_Registry::get('firebug')->info($data); + $this->logger->info($data); // --- Graphique if ( count($data)<=1 ){ $output = false; diff --git a/library/Scores/Session/Entreprise.php b/library/Scores/Session/Entreprise.php index 8707bc562..19c5840ab 100644 --- a/library/Scores/Session/Entreprise.php +++ b/library/Scores/Session/Entreprise.php @@ -3,6 +3,12 @@ class Scores_Session_Entreprise { protected $index = 'entrep'; + /** + * Logger + * @var \Monolog\Logger + */ + protected $logger; + /** * @param string $siret * @param int $id @@ -10,6 +16,10 @@ class Scores_Session_Entreprise */ public function __construct($siret, $id = 0, $set = false) { + if (Zend_Registry::isRegistered('logger')) { + $this->logger = Zend_Registry::get('logger'); + } + if ( !empty($siret) && !$set ) { if (!$this->checkSession($siret, $id) ){ $this->getInfoEntrep($siret, $id); @@ -113,7 +123,7 @@ class Scores_Session_Entreprise protected function getInfoEntrep($siret, $id = 0) { - Zend_Registry::get('firebug')->info('getInfoEntrep'); + $this->logger->info('getInfoEntrep'); require_once 'Scores/WsScores.php'; $ws = new WsScores(); $etab = $ws->getIdentiteLight($siret, $id); diff --git a/library/Scores/Utilisateur.php b/library/Scores/Utilisateur.php index 620ed8570..f4a980426 100644 --- a/library/Scores/Utilisateur.php +++ b/library/Scores/Utilisateur.php @@ -7,9 +7,19 @@ class Scores_Utilisateur */ public $identity = null; + /** + * Logger + * @var \Monolog\Logger + */ + protected $logger; + public function __construct() { - $auth = Zend_Auth::getInstance(); + if (Zend_Registry::isRegistered('logger')) { + $this->logger = Zend_Registry::get('logger'); + } + + $auth = Zend_Auth::getInstance(); if ( $auth->hasIdentity() ) { $this->identity = $auth->getIdentity(); } @@ -333,7 +343,7 @@ class Scores_Utilisateur ); $clientstatM = new Application_Model_ClientStat(); $id = $clientstatM->insert($data); - Zend_Registry::get('firebug')->info('Insertion : '.$id); + $this->logger->info('Insertion : '.$id); } } \ No newline at end of file diff --git a/library/Scores/Ws/Client.php b/library/Scores/Ws/Client.php index 05da83b9f..991baedfd 100644 --- a/library/Scores/Ws/Client.php +++ b/library/Scores/Ws/Client.php @@ -59,6 +59,12 @@ class Scores_Ws_Client extends Zend_Soap_Client */ protected $cache; + /** + * Logger + * @var \Monolog\Logger + */ + protected $logger; + /** * Créer l'environnement nécessaire pour le chargement du webservice * @param string $name @@ -70,6 +76,10 @@ class Scores_Ws_Client extends Zend_Soap_Client */ public function __construct($name, $version, $user = null) { + if (Zend_Registry::isRegistered('logger')) { + $this->logger = Zend_Registry::get('logger'); + } + // --- Configuration de l'application if (Zend_Registry::isRegistered('config')) { $c = Zend_Registry::get('config'); @@ -103,7 +113,7 @@ class Scores_Ws_Client extends Zend_Soap_Client if (PHP_SAPI != 'cli' && $user === null) { $user = new Scores_Utilisateur(); - Zend_Registry::get('firebug')->info($user->getPassword()); + $this->logger->info($user->getPassword()); } if ($user !== null) { @@ -137,7 +147,7 @@ class Scores_Ws_Client extends Zend_Soap_Client } $methodConfig = $this->config[$name]; - Zend_Registry::get('firebug')->info($methodConfig); + $this->logger->info(print_r($methodConfig,1)); // --- Cache $cacheEnable = false; if ( array_key_exists('cache', $methodConfig) ) { @@ -162,8 +172,8 @@ class Scores_Ws_Client extends Zend_Soap_Client // --- Debug if ( array_key_exists('debug', $methodConfig) ) { - Zend_Registry::get('firebug')->info(__CLASS__.'->'.$name); - Zend_Registry::get('firebug')->info($arguments); + $this->logger->info(__CLASS__.'->'.$name); + $this->logger->info(print_r($arguments,1)); } try { @@ -172,7 +182,7 @@ class Scores_Ws_Client extends Zend_Soap_Client // --- Debug if ( array_key_exists('debug', $methodConfig) ) { - Zend_Registry::get('firebug')->info($response); + $this->logger->info(print_r($response,1)); } // --- Cache @@ -186,13 +196,13 @@ class Scores_Ws_Client extends Zend_Soap_Client // --- Debug if ( array_key_exists('debug', $methodConfig) ) { - Zend_Registry::get('firebug')->info($fault->faultcode.' - '.$fault->faultstring); + $this->logger->info($fault->faultcode.' - '.$fault->faultstring); } // --- Gestion des SOAP fault if ( array_key_exists('errorMsg', $methodConfig) ) { if ( in_array($fault->faultcode, $methodConfig['errorMsg']) ) { - Zend_Registry::get('firebug')->info("Exception as error message : ".$fault->faultcode); + $this->logger->info("Exception as error message : ".$fault->faultcode); throw new Exception($fault->faultstring); } } diff --git a/library/Scores/WsScores.php b/library/Scores/WsScores.php index f3c414add..bea3960d0 100644 --- a/library/Scores/WsScores.php +++ b/library/Scores/WsScores.php @@ -39,6 +39,12 @@ class WsScores */ protected $cacheWrite = true; + /** + * Logger + * @var \Monolog\Logger + */ + protected $logger; + /** * Load WebService config * @param string $login @@ -46,7 +52,11 @@ class WsScores */ public function __construct($login = '', $password = '') { - $c = new Zend_Config_Ini(realpath(dirname(__FILE__)) . '/webservices.ini'); + if (Zend_Registry::isRegistered('logger')) { + $this->logger = Zend_Registry::get('logger'); + } + + $c = new Zend_Config_Ini(realpath(dirname(__FILE__)) . '/webservices.ini'); $config = $c->toArray(); $this->webservices = $config['webservices']; if ( !empty($login) && !empty($password) ){ @@ -93,7 +103,7 @@ class WsScores try { $client = new SoapClient($wsdl, $options); } catch (Exception $e) { - Zend_Registry::get('firebug')->info($e->getMessage()); + $this->logger->info($e->getMessage()); throw new Exception('Application Error'); } return $client; @@ -112,7 +122,7 @@ class WsScores $reponse = $client->setBilanEnterCmd($params); return $reponse->setBilanEnterCmdResult; } catch (SoapFault $fault) { - Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring); + $this->logger->info($fault->faultcode.':'.$fault->faultstring); $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse()); return false; } @@ -127,7 +137,7 @@ class WsScores $reponse = $client->getLiasseInfos($params); return $reponse->getLiasseInfosResult; } catch (SoapFault $fault) { - Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring); + $this->logger->info($fault->faultcode.':'.$fault->faultstring); if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){ return $fault->faultstring; } else { @@ -151,7 +161,7 @@ class WsScores $reponse = $client->setContactEt($params); return $reponse->setContactEtResult; } catch (SoapFault $fault) { - Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring); + $this->logger->info($fault->faultcode.':'.$fault->faultstring); return $fault->faultstring; } } @@ -165,7 +175,7 @@ class WsScores $reponse = $client->getContactEt($params); return $reponse->getContactEtResult; } catch (SoapFault $fault) { - Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring); + $this->logger->info($fault->faultcode.':'.$fault->faultstring); return $fault->faultstring; } } @@ -198,7 +208,7 @@ class WsScores } return $reponse->getContactEtResult; } catch (SoapFault $fault) { - Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring); + $this->logger->info($fault->faultcode.':'.$fault->faultstring); if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){ return $fault->faultstring; } else { @@ -305,7 +315,7 @@ class WsScores $reponse = $client->setSurveillancesMail($params); return $reponse->setSurveillancesMailResult; } catch (SoapFault $fault) { - Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring); + $this->logger->info($fault->faultcode.':'.$fault->faultstring); if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){ return $fault->faultstring; } else { @@ -325,7 +335,7 @@ class WsScores $reponse = $client->setUserService($params); return $reponse->setUserServiceResult; } catch (SoapFault $fault) { - Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring); + $this->logger->info($fault->faultcode.':'.$fault->faultstring); if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){ return $fault->faultstring; } else { @@ -446,7 +456,7 @@ class WsScores $reponse = $client->setLienChange($params); return $reponse->setLienChangeResult; } catch (SoapFault $fault) { - Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring); + $this->logger->info($fault->faultcode.':'.$fault->faultstring); if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){ return $fault->faultstring; } else { @@ -486,7 +496,7 @@ class WsScores $reponse = $client->setScoreCutoff($params); return $reponse->setScoreCutoffResult; } catch (SoapFault $fault) { - Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring); + $this->logger->info($fault->faultcode.':'.$fault->faultstring); return $fault->faultstring; } } @@ -505,7 +515,7 @@ class WsScores $reponse = $client->getScoreCutoff($params); return $reponse->getScoreCutoffResult; } catch (SoapFault $fault) { - Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring); + $this->logger->info($fault->faultcode.':'.$fault->faultstring); return $fault->faultstring; } } @@ -524,7 +534,7 @@ class WsScores $reponse = $client->delScoreCutoff($params); //change name when webservice is ready return $reponse->delScoreCutoffResult; //change name when webservice is ready } catch (SoapFault $fault) { - Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring); + $this->logger->info($fault->faultcode.':'.$fault->faultstring); return $fault->faultstring; } } @@ -539,7 +549,7 @@ class WsScores $reponse = $client->searchLogin($params); return $reponse->searchLoginResult; } catch (SoapFault $fault) { - Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring); + $this->logger->info($fault->faultcode.':'.$fault->faultstring); $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse()); return false; } @@ -562,7 +572,7 @@ class WsScores $cache->setBlock($reponse->getCurrencyResult); return $reponse->getCurrencyResult; } catch (SoapFault $fault) { - Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring); + $this->logger->info($fault->faultcode.':'.$fault->faultstring); $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse()); return false; } @@ -591,7 +601,7 @@ class WsScores $cache->setBlock($reponse->getCountryResult); return $reponse->getCountryResult; } catch (SoapFault $fault) { - Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring); + $this->logger->info($fault->faultcode.':'.$fault->faultstring); $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse()); return false; } @@ -607,7 +617,7 @@ class WsScores $reponse = $client->setBourse($params); return $reponse->setBourseResult; } catch (SoapFault $fault) { - Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring); + $this->logger->info($fault->faultcode.':'.$fault->faultstring); if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){ return $fault->faultstring; } else { @@ -626,7 +636,7 @@ class WsScores $reponse = $client->getBourse($params); return $reponse->getBourseResult; } catch (SoapFault $fault) { - Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring); + $this->logger->info($fault->faultcode.':'.$fault->faultstring); if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){ return $fault->faultstring; } else { @@ -647,7 +657,7 @@ class WsScores $reponse = $client->setService($params); return $reponse->setServiceResult; } catch (SoapFault $fault) { - Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring); + $this->logger->info($fault->faultcode.':'.$fault->faultstring); if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){ return $fault->faultstring; } else { @@ -665,10 +675,10 @@ class WsScores $client = $this->loadClient('gestion'); try { $reponse = $client->getServiceUsers($params); - Zend_Registry::get('firebug')->info($reponse); + $this->logger->info(print_r($reponse,1)); return $reponse->getServiceUsersResult; } catch (SoapFault $fault) { - Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring); + $this->logger->info($fault->faultcode.':'.$fault->faultstring); if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){ return $fault->faultstring; } else { @@ -687,7 +697,7 @@ class WsScores $reponse = $client->getServices($params); return $reponse->getServicesResult; } catch (SoapFault $fault) { - Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring); + $this->logger->info($fault->faultcode.':'.$fault->faultstring); if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){ return $fault->faultstring; } else { @@ -706,7 +716,7 @@ class WsScores $reponse = $client->getCountryId($params); return $reponse->getCountryIdResult; } catch (SoapFault $fault) { - Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring); + $this->logger->info($fault->faultcode.':'.$fault->faultstring); if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){ return $fault->faultstring; } else { @@ -725,7 +735,7 @@ class WsScores $reponse = $client->getLien($params); return $reponse->getLienResult; } catch (SoapFault $fault) { - Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring); + $this->logger->info($fault->faultcode.':'.$fault->faultstring); if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){ return $fault->faultstring; } else { @@ -746,7 +756,7 @@ class WsScores $reponse = $client->getLienDoc($params); return $reponse->getLienDocResult; } catch (SoapFault $fault) { - Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring); + $this->logger->info($fault->faultcode.':'.$fault->faultstring); $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse()); return false; } @@ -762,7 +772,7 @@ class WsScores $reponse = $client->setLienDoc($params); return $reponse->setLienDocResult; } catch (SoapFault $fault) { - Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring); + $this->logger->info($fault->faultcode.':'.$fault->faultstring); $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse()); return false; } @@ -778,7 +788,7 @@ class WsScores $reponse = $client->setLien($params); return $reponse->setLienResult; } catch (SoapFault $fault) { - Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring); + $this->logger->info($fault->faultcode.':'.$fault->faultstring); if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){ return $fault->faultstring; } else { @@ -797,7 +807,7 @@ class WsScores $reponse = $client->getLienRef($params); return $reponse->getLienRefResult; } catch (SoapFault $fault) { - Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring); + $this->logger->info($fault->faultcode.':'.$fault->faultstring); if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){ return $fault->faultstring; } else { @@ -816,7 +826,7 @@ class WsScores $reponse = $client->getLienRef($params); return $reponse->getLienRefResult; } catch (SoapFault $fault) { - Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring); + $this->logger->info($fault->faultcode.':'.$fault->faultstring); if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){ return $fault->faultstring; } else { @@ -836,7 +846,7 @@ class WsScores $reponse = $client->setLienRef($params); return $reponse->setLienRefResult; } catch (SoapFault $fault) { - Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring); + $this->logger->info($fault->faultcode.':'.$fault->faultstring); if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){ return $fault->faultstring; } else { @@ -856,7 +866,7 @@ class WsScores $reponse = $client->searchLienRef($params); return $reponse->searchLienRefResult; } catch (SoapFault $fault) { - Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring); + $this->logger->info($fault->faultcode.':'.$fault->faultstring); if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){ return $fault->faultstring; } else { @@ -879,7 +889,7 @@ class WsScores $reponse = $client->setActeAsso($params); return $reponse->setActeAssoResult; } catch (SoapFault $fault) { - Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring); + $this->logger->info($fault->faultcode.':'.$fault->faultstring); if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){ return $fault->faultstring; } else { @@ -908,7 +918,7 @@ class WsScores $reponse = $client->setBilan($params); return $reponse->setBilanResult; } catch (SoapFault $fault) { - Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring); + $this->logger->info($fault->faultcode.':'.$fault->faultstring); if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){ return $fault->faultstring; } else { @@ -938,7 +948,7 @@ class WsScores $reponse = $client->getBilans($params); return $reponse->getBilansResult; } catch (SoapFault $fault) { - Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring); + $this->logger->info($fault->faultcode.':'.$fault->faultstring); $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse()); return false; } @@ -963,10 +973,10 @@ class WsScores $client = $this->loadClient('pieces'); try { $reponse = $client->getBilan($params); - Zend_Registry::get('firebug')->info($reponse); + $this->logger->info(print_r($reponse,1)); return $reponse->getBilanResult; } catch (SoapFault $fault) { - Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring); + $this->logger->info($fault->faultcode.':'.$fault->faultstring); $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse()); return false; } @@ -986,10 +996,10 @@ class WsScores $client = $this->loadClient('pieces'); try { $reponse = $client->getActe($params); - Zend_Registry::get('firebug')->info($reponse); + $this->logger->info(print_r($reponse,1)); return $reponse->getActeResult; } catch (SoapFault $fault) { - Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring); + $this->logger->info($fault->faultcode.':'.$fault->faultstring); $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse()); return false; } @@ -1006,7 +1016,7 @@ class WsScores $reponse = $client->getActes($params); return $reponse->getActesResult; } catch (SoapFault $fault) { - Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring); + $this->logger->info($fault->faultcode.':'.$fault->faultstring); $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse()); return false; } @@ -1025,7 +1035,7 @@ class WsScores if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){ return $fault->faultstring; } else { - Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring); + $this->logger->info($fault->faultcode.':'.$fault->faultstring); $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse()); return false; } @@ -1045,7 +1055,7 @@ class WsScores if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){ return $fault->faultstring; } else { - Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring); + $this->logger->info($fault->faultcode.':'.$fault->faultstring); $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse()); return false; } @@ -1065,7 +1075,7 @@ class WsScores if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){ return $fault->faultstring; } else { - Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring); + $this->logger->info($fault->faultcode.':'.$fault->faultstring); $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse()); return false; } @@ -1079,7 +1089,7 @@ class WsScores $client = $this->loadClient('gestion'); try { $reponse = $client->setCGU($params); - Zend_Registry::get('firebug')->info($reponse); + $this->logger->info(print_r($reponse,1)); return $reponse->setCGUResult; } catch(SoapFault $fault) { $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse()); @@ -1119,7 +1129,7 @@ class WsScores $client = $this->loadClient('gestion'); try { $reponse = $client->getEmail($params); - Zend_Registry::get('firebug')->info($reponse); + $this->logger->info(print_r($reponse,1)); return $reponse->getEmailResult; } catch (SoapFault $fault) { $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse()); @@ -1229,7 +1239,7 @@ class WsScores return $reponse->getKbisResult; } catch (SoapFault $fault) { if ( in_array($fault->faultcode, array('0000', 'MSG')) ){ - Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring); + $this->logger->info($fault->faultcode.':'.$fault->faultstring); return $fault->faultstring; } else { $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse()); @@ -1678,7 +1688,7 @@ class WsScores $reponse = $client->setMandataire($params); return $reponse->setMandataireResult; } catch (SoapFault $fault) { - Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring); + $this->logger->info($fault->faultcode.':'.$fault->faultstring); if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){ return $fault->faultstring; } else { @@ -2329,7 +2339,7 @@ class WsScores $client = $this->loadClient('entreprise'); try { $reponse = $client->getAnnoncesLegales($params); - Zend_Registry::get('firebug')->info($reponse); + $this->logger->info(print_r($reponse,1)); if ($this->cacheWrite) { $cache->deletefile(); $cache->setBlock($reponse->getAnnoncesLegalesResult); @@ -2689,7 +2699,7 @@ class WsScores $reponse = $client->setDirigeantsOp($params); return $reponse->setDirigeantsOpResult; } catch (SoapFault $fault) { - Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring); + $this->logger->info($fault->faultcode.':'.$fault->faultstring); if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){ return $fault->faultstring; } else { @@ -2726,7 +2736,7 @@ class WsScores } return $reponse->getAvisRncsResult; } catch (SoapFault $fault) { - Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring); + $this->logger->info($fault->faultcode.':'.$fault->faultstring); if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){ return $fault->faultstring; } else { @@ -3118,7 +3128,7 @@ class WsScores return $reponse->setCmdAssoResult; } catch (SoapFault $fault) { $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse()); - Zend_Registry::get('firebug')->info($fault); + $this->logger->info(print_r($fault,1)); //Placer exception pour affichage message return false; } @@ -3171,7 +3181,7 @@ class WsScores return $fault->getMessage(); } else { $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse()); - Zend_Registry::get('firebug')->info($fault); + $this->logger->info(print_r($fault,1)); //Placer exception pour affichage message return false; @@ -3235,11 +3245,11 @@ class WsScores try { $client = $this->loadClient('gestion'); $reponse = $client->getNextLogin($params); - Zend_Registry::get('firebug')->info($reponse); + $this->logger->info(print_r($reponse,1)); return $reponse->getNextLoginResult; } catch (SoapFault $fault) { $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse()); - Zend_Registry::get('firebug')->info($fault); + $this->logger->info(print_r($fault,1)); //Placer exception pour affichage message return false; } @@ -3372,7 +3382,7 @@ class WsScores $message.= "Reponse :\n ".$reponse."\n"; if (APPLICATION_ENV == 'development' ) { - Zend_Registry::get('firebug')->info('Erreur SOAP - Code : '.$fault->faultcode.' - Message : '.$fault->faultstring); + $this->logger->info('Erreur SOAP - Code : '.$fault->faultcode.' - Message : '.$fault->faultstring); } else { $c = Zend_Registry::get('config'); $mail = new Scores_Mail_Method();