This commit is contained in:
Michael RICOIS 2017-02-13 14:08:23 +01:00
parent f55fa25915
commit cc4592eddd
16 changed files with 210 additions and 106 deletions

View File

@ -1,9 +1,19 @@
<?php <?php
class Application_Controller_Plugin_Auth extends Zend_Controller_Plugin_Abstract class Application_Controller_Plugin_Auth extends Zend_Controller_Plugin_Abstract
{ {
public function preDispatch(Zend_Controller_Request_Abstract $request) /**
* Logger
* @var \Monolog\Logger
*/
protected $logger;
public function preDispatch(Zend_Controller_Request_Abstract $request)
{ {
Zend_Registry::get('firebug')->info('PLUGIN AUTH - START'); if (Zend_Registry::isRegistered('logger')) {
$logger = Zend_Registry::get('logger');
}
$logger->info('PLUGIN AUTH - START');
$module = $request->getModuleName(); $module = $request->getModuleName();
$controller = $request->getControllerName(); $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 // --- On vérifie le tout lors d'une connexion par url
if ( !empty($login) && !empty($hach) ) { if ( !empty($login) && !empty($hach) ) {
Zend_Registry::get('firebug')->info('AUTH : IPONLY'); $logger->info('AUTH : IPONLY');
// --- Mode hach // --- Mode hach
if ($mode === null) { 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');
} }
} }

View File

@ -9,7 +9,11 @@ class Application_Controller_Plugin_Cgu extends Zend_Controller_Plugin_Abstract
*/ */
public function preDispatch(Zend_Controller_Request_Abstract $request) 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(); $layout = Zend_Layout::getMVCInstance();
if ($layout->isEnabled()) { if ($layout->isEnabled()) {
@ -57,6 +61,6 @@ class Application_Controller_Plugin_Cgu extends Zend_Controller_Plugin_Abstract
break; break;
} }
} }
Zend_Registry::get('firebug')->info('PLUGIN CGU - END'); $logger->info('PLUGIN CGU - END');
} }
} }

View File

@ -9,7 +9,11 @@ class Application_Controller_Plugin_Lang extends Zend_Controller_Plugin_Abstract
*/ */
public function preDispatch(Zend_Controller_Request_Abstract $request) 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(); $auth = Zend_Auth::getInstance();
if ( $auth->hasIdentity() ) { 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_Locale', $locale);
$registry->set('Zend_Translate', $translate); $registry->set('Zend_Translate', $translate);
Zend_Registry::get('firebug')->info('PLUGIN LANG - END'); $logger->info('PLUGIN LANG - END');
} }
} }

View File

@ -7,7 +7,11 @@ class Application_Controller_Plugin_Menu extends Zend_Controller_Plugin_Abstract
*/ */
public function preDispatch(Zend_Controller_Request_Abstract $request) 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(); $layout = Zend_Layout::getMVCInstance();
$user = new Scores_Utilisateur(); $user = new Scores_Utilisateur();
@ -80,6 +84,6 @@ class Application_Controller_Plugin_Menu extends Zend_Controller_Plugin_Abstract
//$view->aide = true; //$view->aide = true;
} }
Zend_Registry::get('firebug')->info('PLUGIN MENU - END'); $logger->info('PLUGIN MENU - END');
} }
} }

View File

@ -3,7 +3,11 @@ class Application_Controller_Plugin_Pdf extends Zend_Controller_Plugin_Abstract
{ {
public function dispatchLoopShutdown() 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(); $layout = Zend_Layout::getMVCInstance();
if ($layout->isEnabled()) { 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');
} }
} }

View File

@ -3,7 +3,11 @@ class Application_Controller_Plugin_Theme extends Zend_Controller_Plugin_Abstrac
{ {
public function preDispatch(Zend_Controller_Request_Abstract $request) 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(); $auth = Zend_Auth::getInstance();
$theme = 'default'; //$theme = 'mobile'; $theme = 'default'; //$theme = 'mobile';
@ -129,6 +133,6 @@ class Application_Controller_Plugin_Theme extends Zend_Controller_Plugin_Abstrac
break; break;
} }
Zend_Registry::get('firebug')->info('PLUGIN THEME - STOP'); $logger->info('PLUGIN THEME - STOP');
} }
} }

View File

@ -3,7 +3,11 @@ class Application_Controller_Plugin_Xml extends Zend_Controller_Plugin_Abstract
{ {
public function dispatchLoopShutdown() 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(); $layout = Zend_Layout::getMVCInstance();
if ($layout->isEnabled()) { 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');
} }
} }

View File

@ -547,7 +547,7 @@ class Infogreffe
$bilan['mode_diffusion'][] = $mode->getAttribute('type'); $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 //Génération de l'index pour le tri
$date = $bilan['date_cloture_iso']; $date = $bilan['date_cloture_iso'];
@ -628,17 +628,17 @@ class Infogreffe
->where('date=?', $date) ->where('date=?', $date)
->where('num=?', $acte['num_acte']) ->where('num=?', $acte['num_acte'])
->where('file LIKE "acte-'.$siren.'-%-'.$date.'-%-'.$depot['num_depot'].'-'.$acte['num_acte'].'.pdf"'); ->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); $result = $actesM->fetchRow($sql);
if ( null !== $result ) { if ( null !== $result ) {
Zend_Registry::get('firebug')->info($result); $this->logger->info($result);
$fichier = $this->pathData.$this->actePath($ref).$result->file; $fichier = $this->pathData.$this->actePath($ref).$result->file;
Zend_Registry::get('firebug')->info($fichier); $this->logger->info($fichier);
if ( file_exists($fichier) ) if ( file_exists($fichier) )
{ {
Zend_Registry::get('firebug')->info($acte); $this->logger->info($acte);
if ($result->type != $acte['type_acte'] && $result->type2 == '') { if ($result->type != $acte['type_acte'] && $result->type2 == '') {
Zend_Registry::get('firebug')->info('Update Database'); $this->logger->info('Update Database');
//Add to the database //Add to the database
try { try {
$actesM->update(array( $actesM->update(array(
@ -648,7 +648,7 @@ class Infogreffe
'date_depot' => $dateDepot->toString('yyyyMMdd') 'date_depot' => $dateDepot->toString('yyyyMMdd')
), 'id='.$result->id); ), 'id='.$result->id);
} catch (Zend_Exception $e) { } catch (Zend_Exception $e) {
Zend_Registry::get('firebug')->info($e->getMessage()); $this->logger->info($e->getMessage());
} }
} else { } else {
try { try {
@ -658,7 +658,7 @@ class Infogreffe
'date_depot' => $dateDepot->toString('yyyyMMdd') 'date_depot' => $dateDepot->toString('yyyyMMdd')
), 'id='.$result->id); ), 'id='.$result->id);
} catch (Zend_Exception $e) { } catch (Zend_Exception $e) {
Zend_Registry::get('firebug')->info($e->getMessage()); $this->logger->info($e->getMessage());
} }
} }
$ref = str_replace('.pdf', '',substr($result->file,15)); $ref = str_replace('.pdf', '',substr($result->file,15));
@ -770,7 +770,7 @@ class Infogreffe
//Cas de fichier correspondant à la référence //Cas de fichier correspondant à la référence
$fichier = $this->pathData.$this->bilanPath($ref).$this->bilanFilename($siren,$ref); $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 ) if( file_exists($fichier) && filesize($fichier)>0 )
{ {
$mode = 'fichier'; $mode = 'fichier';

View File

@ -39,6 +39,12 @@ class Scores_Auth_Adapter_Ws implements Zend_Auth_Adapter_Interface
'62.210.222.34', '62.210.222.34',
); );
/**
* Logger
* @var \Monolog\Logger
*/
protected $logger;
/** /**
* Authentification par WS * Authentification par WS
* @param string $username * @param string $username
@ -62,6 +68,10 @@ class Scores_Auth_Adapter_Ws implements Zend_Auth_Adapter_Interface
$this->_password = 'iponly:'.$ip; $this->_password = 'iponly:'.$ip;
$this->_checkIp = true; $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'; $parameters->from = 'auth';
$InfosLogin = $ws->getInfosLogin($parameters); $InfosLogin = $ws->getInfosLogin($parameters);
Zend_Registry::get('firebug')->info(__CLASS__ . ' : '.__METHOD__); $this->logger->info(__CLASS__ . ' : '.__METHOD__);
Zend_Registry::get('firebug')->info($InfosLogin); $this->logger->info($InfosLogin);
// --- Renvoi // --- Renvoi
if ( is_string($InfosLogin) || $InfosLogin->error->errnum != 0 ) { if ( is_string($InfosLogin) || $InfosLogin->error->errnum != 0 ) {
$message = $InfosLogin; $message = $InfosLogin;
@ -96,12 +106,12 @@ class Scores_Auth_Adapter_Ws implements Zend_Auth_Adapter_Interface
elseif ( $InfosLogin !== false && !empty($InfosLogin->result->login)) { elseif ( $InfosLogin !== false && !empty($InfosLogin->result->login)) {
$identity = new stdClass(); $identity = new stdClass();
if ($this->_checkIp || $this->_checkHach) { if ($this->_checkIp || $this->_checkHach) {
Zend_Registry::get('firebug')->info("IN"); $this->logger->info("IN");
$identity->password = $this->_password; $identity->password = $this->_password;
} else { } else {
$identity->password = md5($InfosLogin->result->login.'|'.$this->_password); $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->username = $InfosLogin->result->login;
$identity->email = $InfosLogin->result->email; $identity->email = $InfosLogin->result->email;
$identity->profil = $InfosLogin->result->profil; $identity->profil = $InfosLogin->result->profil;

View File

@ -211,12 +211,12 @@ class Scores_Google_Streetview
$response = $client->request('GET'); $response = $client->request('GET');
if ( $response->isSuccessful() ) { if ( $response->isSuccessful() ) {
if (!copy($response->getStreamName(), $this->pathImg())) { if (!copy($response->getStreamName(), $this->pathImg())) {
Zend_Registry::get('firebug')->info('Erreur copie image !'); $this->logger->info('Erreur copie image !');
return false; return false;
} }
} }
} catch (Zend_Http_Client_Exception $e) { } catch (Zend_Http_Client_Exception $e) {
Zend_Registry::get('firebug')->info('HTTP Exception : '.$e->getMessage()); $this->logger->info('HTTP Exception : '.$e->getMessage());
return false; return false;
} }
} }

View File

@ -5,6 +5,12 @@ class IdentiteProcol
protected $annonces = array(); protected $annonces = array();
protected $procol; protected $procol;
/**
* Logger
* @var \Monolog\Logger
*/
protected $logger;
/** /**
* Construit l'identite entreprise afin de retourner les éléments formatter * Construit l'identite entreprise afin de retourner les éléments formatter
* pour l'affichage * pour l'affichage
@ -13,7 +19,11 @@ class IdentiteProcol
*/ */
public function __construct($infos) 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 = new stdClass();
$this->procol->LibTypeEtab = $infos->LibTypeEtab; $this->procol->LibTypeEtab = $infos->LibTypeEtab;
$this->procol->StatutsConstDepot = $infos->StatutsConstDepot; $this->procol->StatutsConstDepot = $infos->StatutsConstDepot;
@ -39,7 +49,7 @@ class IdentiteProcol
} }
} }
} }
Zend_Registry::get('firebug')->info($this->annonces); $this->logger->info($this->annonces);
$this->view = new Zend_View(); $this->view = new Zend_View();
} }

View File

@ -18,8 +18,18 @@ class RapportComment
protected $graphCouleurs = array(); protected $graphCouleurs = array();
protected $pathImage = ''; protected $pathImage = '';
/**
* Logger
* @var \Monolog\Logger
*/
protected $logger;
public function __construct($siret, $id, $tabCommentaires = array(), $RatiosInfos = null, $BilansInfos = null, $RatiosSecteur = null, $tabProjection = array()) 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 //Assignation
$this->commentaires = $tabCommentaires; $this->commentaires = $tabCommentaires;
$c = Zend_Registry::get('config'); $c = Zend_Registry::get('config');
@ -307,12 +317,12 @@ class RapportComment
$pattern = '/COULEUR\((.*)\)/i'; $pattern = '/COULEUR\((.*)\)/i';
///Detection couleur ///Detection couleur
if ( preg_match($pattern, $content, $matches) ) { if ( preg_match($pattern, $content, $matches) ) {
Zend_Registry::get('firebug')->info('DETECTION Couleurs'); $this->logger->info('DETECTION Couleurs');
$listeCouleurs = $matches[1]; $listeCouleurs = $matches[1];
//Récupération des couleurs //Récupération des couleurs
$pattern = '/([a-z0-9]{3,4})/i'; $pattern = '/([a-z0-9]{3,4})/i';
if ( preg_match_all($pattern, $listeCouleurs, $matches) ) { if ( preg_match_all($pattern, $listeCouleurs, $matches) ) {
Zend_Registry::get('firebug')->info($matches); $this->logger->info($matches);
$nbCouleurs = count($matches[1]); $nbCouleurs = count($matches[1]);
for($i=0;$i<$nbCouleurs;$i++){ for($i=0;$i<$nbCouleurs;$i++){
$this->graphCouleurs[] = $assocNomCouleurs[$matches[1][$i]]; $this->graphCouleurs[] = $assocNomCouleurs[$matches[1][$i]];
@ -327,7 +337,7 @@ class RapportComment
{ {
$pattern = '/\[GRAPHIQUE id=(.*?) titre=\'(.*?)\',(.*)\]/'; $pattern = '/\[GRAPHIQUE id=(.*?) titre=\'(.*?)\',(.*)\]/';
if( preg_match($pattern, $content, $matches) ){ if( preg_match($pattern, $content, $matches) ){
Zend_Registry::get('firebug')->info($content); $this->logger->info($content);
$image_id = $matches[1]; $image_id = $matches[1];
$titre = $matches[2]; $titre = $matches[2];
//Génération id/nom fichier graphique //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){ switch($detectType){
case 'histo': case 'histo':
@ -494,10 +504,10 @@ class RapportComment
if( $this->cache_graph($this->pathImage.$file) ){ if( $this->cache_graph($this->pathImage.$file) ){
$output = $file; $output = $file;
} else { } else {
Zend_Registry::get('firebug')->info('Histo - id : '.$id); $this->logger->info('Histo - id : '.$id);
Zend_Registry::get('firebug')->info('Histo - titre : '.$titre); $this->logger->info('Histo - titre : '.$titre);
Zend_Registry::get('firebug')->info('Histo - strRatios : '.$strRatios); $this->logger->info('Histo - strRatios : '.$strRatios);
Zend_Registry::get('firebug')->info($this->ratiosEntrep); $this->logger->info($this->ratiosEntrep);
// --- Gestion des couleurs // --- Gestion des couleurs
if(count($this->graphCouleurs)>0){ if(count($this->graphCouleurs)>0){
$couleurs = $this->graphCouleurs; $couleurs = $this->graphCouleurs;
@ -574,7 +584,7 @@ class RapportComment
} }
} }
if ( !isset($unite) ) { $unite = 'EUR'; } if ( !isset($unite) ) { $unite = 'EUR'; }
Zend_Registry::get('firebug')->info($data); $this->logger->info($data);
// --- Graphique // --- Graphique
if ( count($data)<=1 ){ if ( count($data)<=1 ){
$output = false; $output = false;

View File

@ -3,6 +3,12 @@ class Scores_Session_Entreprise
{ {
protected $index = 'entrep'; protected $index = 'entrep';
/**
* Logger
* @var \Monolog\Logger
*/
protected $logger;
/** /**
* @param string $siret * @param string $siret
* @param int $id * @param int $id
@ -10,6 +16,10 @@ class Scores_Session_Entreprise
*/ */
public function __construct($siret, $id = 0, $set = false) public function __construct($siret, $id = 0, $set = false)
{ {
if (Zend_Registry::isRegistered('logger')) {
$this->logger = Zend_Registry::get('logger');
}
if ( !empty($siret) && !$set ) { if ( !empty($siret) && !$set ) {
if (!$this->checkSession($siret, $id) ){ if (!$this->checkSession($siret, $id) ){
$this->getInfoEntrep($siret, $id); $this->getInfoEntrep($siret, $id);
@ -113,7 +123,7 @@ class Scores_Session_Entreprise
protected function getInfoEntrep($siret, $id = 0) protected function getInfoEntrep($siret, $id = 0)
{ {
Zend_Registry::get('firebug')->info('getInfoEntrep'); $this->logger->info('getInfoEntrep');
require_once 'Scores/WsScores.php'; require_once 'Scores/WsScores.php';
$ws = new WsScores(); $ws = new WsScores();
$etab = $ws->getIdentiteLight($siret, $id); $etab = $ws->getIdentiteLight($siret, $id);

View File

@ -7,9 +7,19 @@ class Scores_Utilisateur
*/ */
public $identity = null; public $identity = null;
/**
* Logger
* @var \Monolog\Logger
*/
protected $logger;
public function __construct() 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() ) { if ( $auth->hasIdentity() ) {
$this->identity = $auth->getIdentity(); $this->identity = $auth->getIdentity();
} }
@ -333,7 +343,7 @@ class Scores_Utilisateur
); );
$clientstatM = new Application_Model_ClientStat(); $clientstatM = new Application_Model_ClientStat();
$id = $clientstatM->insert($data); $id = $clientstatM->insert($data);
Zend_Registry::get('firebug')->info('Insertion : '.$id); $this->logger->info('Insertion : '.$id);
} }
} }

View File

@ -59,6 +59,12 @@ class Scores_Ws_Client extends Zend_Soap_Client
*/ */
protected $cache; protected $cache;
/**
* Logger
* @var \Monolog\Logger
*/
protected $logger;
/** /**
* Créer l'environnement nécessaire pour le chargement du webservice * Créer l'environnement nécessaire pour le chargement du webservice
* @param string $name * @param string $name
@ -70,6 +76,10 @@ class Scores_Ws_Client extends Zend_Soap_Client
*/ */
public function __construct($name, $version, $user = null) public function __construct($name, $version, $user = null)
{ {
if (Zend_Registry::isRegistered('logger')) {
$this->logger = Zend_Registry::get('logger');
}
// --- Configuration de l'application // --- Configuration de l'application
if (Zend_Registry::isRegistered('config')) { if (Zend_Registry::isRegistered('config')) {
$c = Zend_Registry::get('config'); $c = Zend_Registry::get('config');
@ -103,7 +113,7 @@ class Scores_Ws_Client extends Zend_Soap_Client
if (PHP_SAPI != 'cli' && $user === null) { if (PHP_SAPI != 'cli' && $user === null) {
$user = new Scores_Utilisateur(); $user = new Scores_Utilisateur();
Zend_Registry::get('firebug')->info($user->getPassword()); $this->logger->info($user->getPassword());
} }
if ($user !== null) { if ($user !== null) {
@ -137,7 +147,7 @@ class Scores_Ws_Client extends Zend_Soap_Client
} }
$methodConfig = $this->config[$name]; $methodConfig = $this->config[$name];
Zend_Registry::get('firebug')->info($methodConfig); $this->logger->info($methodConfig);
// --- Cache // --- Cache
$cacheEnable = false; $cacheEnable = false;
if ( array_key_exists('cache', $methodConfig) ) { if ( array_key_exists('cache', $methodConfig) ) {
@ -162,8 +172,8 @@ class Scores_Ws_Client extends Zend_Soap_Client
// --- Debug // --- Debug
if ( array_key_exists('debug', $methodConfig) ) { if ( array_key_exists('debug', $methodConfig) ) {
Zend_Registry::get('firebug')->info(__CLASS__.'->'.$name); $this->logger->info(__CLASS__.'->'.$name);
Zend_Registry::get('firebug')->info($arguments); $this->logger->info($arguments);
} }
try { try {
@ -172,7 +182,7 @@ class Scores_Ws_Client extends Zend_Soap_Client
// --- Debug // --- Debug
if ( array_key_exists('debug', $methodConfig) ) { if ( array_key_exists('debug', $methodConfig) ) {
Zend_Registry::get('firebug')->info($response); $this->logger->info($response);
} }
// --- Cache // --- Cache
@ -186,13 +196,13 @@ class Scores_Ws_Client extends Zend_Soap_Client
// --- Debug // --- Debug
if ( array_key_exists('debug', $methodConfig) ) { 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 // --- Gestion des SOAP fault
if ( array_key_exists('errorMsg', $methodConfig) ) { if ( array_key_exists('errorMsg', $methodConfig) ) {
if ( in_array($fault->faultcode, $methodConfig['errorMsg']) ) { 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); throw new Exception($fault->faultstring);
} }
} }

View File

@ -39,6 +39,12 @@ class WsScores
*/ */
protected $cacheWrite = true; protected $cacheWrite = true;
/**
* Logger
* @var \Monolog\Logger
*/
protected $logger;
/** /**
* Load WebService config * Load WebService config
* @param string $login * @param string $login
@ -46,7 +52,11 @@ class WsScores
*/ */
public function __construct($login = '', $password = '') 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(); $config = $c->toArray();
$this->webservices = $config['webservices']; $this->webservices = $config['webservices'];
if ( !empty($login) && !empty($password) ){ if ( !empty($login) && !empty($password) ){
@ -93,7 +103,7 @@ class WsScores
try { try {
$client = new SoapClient($wsdl, $options); $client = new SoapClient($wsdl, $options);
} catch (Exception $e) { } catch (Exception $e) {
Zend_Registry::get('firebug')->info($e->getMessage()); $this->logger->info($e->getMessage());
throw new Exception('Application Error'); throw new Exception('Application Error');
} }
return $client; return $client;
@ -112,7 +122,7 @@ class WsScores
$reponse = $client->setBilanEnterCmd($params); $reponse = $client->setBilanEnterCmd($params);
return $reponse->setBilanEnterCmdResult; return $reponse->setBilanEnterCmdResult;
} catch (SoapFault $fault) { } 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()); $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
return false; return false;
} }
@ -127,7 +137,7 @@ class WsScores
$reponse = $client->getLiasseInfos($params); $reponse = $client->getLiasseInfos($params);
return $reponse->getLiasseInfosResult; return $reponse->getLiasseInfosResult;
} catch (SoapFault $fault) { } 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')) ){ if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
return $fault->faultstring; return $fault->faultstring;
} else { } else {
@ -151,7 +161,7 @@ class WsScores
$reponse = $client->setContactEt($params); $reponse = $client->setContactEt($params);
return $reponse->setContactEtResult; return $reponse->setContactEtResult;
} catch (SoapFault $fault) { } catch (SoapFault $fault) {
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring); $this->logger->info($fault->faultcode.':'.$fault->faultstring);
return $fault->faultstring; return $fault->faultstring;
} }
} }
@ -165,7 +175,7 @@ class WsScores
$reponse = $client->getContactEt($params); $reponse = $client->getContactEt($params);
return $reponse->getContactEtResult; return $reponse->getContactEtResult;
} catch (SoapFault $fault) { } catch (SoapFault $fault) {
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring); $this->logger->info($fault->faultcode.':'.$fault->faultstring);
return $fault->faultstring; return $fault->faultstring;
} }
} }
@ -198,7 +208,7 @@ class WsScores
} }
return $reponse->getContactEtResult; return $reponse->getContactEtResult;
} catch (SoapFault $fault) { } 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')) ){ if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
return $fault->faultstring; return $fault->faultstring;
} else { } else {
@ -305,7 +315,7 @@ class WsScores
$reponse = $client->setSurveillancesMail($params); $reponse = $client->setSurveillancesMail($params);
return $reponse->setSurveillancesMailResult; return $reponse->setSurveillancesMailResult;
} catch (SoapFault $fault) { } 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')) ){ if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
return $fault->faultstring; return $fault->faultstring;
} else { } else {
@ -325,7 +335,7 @@ class WsScores
$reponse = $client->setUserService($params); $reponse = $client->setUserService($params);
return $reponse->setUserServiceResult; return $reponse->setUserServiceResult;
} catch (SoapFault $fault) { } 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')) ){ if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
return $fault->faultstring; return $fault->faultstring;
} else { } else {
@ -446,7 +456,7 @@ class WsScores
$reponse = $client->setLienChange($params); $reponse = $client->setLienChange($params);
return $reponse->setLienChangeResult; return $reponse->setLienChangeResult;
} catch (SoapFault $fault) { } 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')) ){ if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
return $fault->faultstring; return $fault->faultstring;
} else { } else {
@ -486,7 +496,7 @@ class WsScores
$reponse = $client->setScoreCutoff($params); $reponse = $client->setScoreCutoff($params);
return $reponse->setScoreCutoffResult; return $reponse->setScoreCutoffResult;
} catch (SoapFault $fault) { } catch (SoapFault $fault) {
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring); $this->logger->info($fault->faultcode.':'.$fault->faultstring);
return $fault->faultstring; return $fault->faultstring;
} }
} }
@ -505,7 +515,7 @@ class WsScores
$reponse = $client->getScoreCutoff($params); $reponse = $client->getScoreCutoff($params);
return $reponse->getScoreCutoffResult; return $reponse->getScoreCutoffResult;
} catch (SoapFault $fault) { } catch (SoapFault $fault) {
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring); $this->logger->info($fault->faultcode.':'.$fault->faultstring);
return $fault->faultstring; return $fault->faultstring;
} }
} }
@ -524,7 +534,7 @@ class WsScores
$reponse = $client->delScoreCutoff($params); //change name when webservice is ready $reponse = $client->delScoreCutoff($params); //change name when webservice is ready
return $reponse->delScoreCutoffResult; //change name when webservice is ready return $reponse->delScoreCutoffResult; //change name when webservice is ready
} catch (SoapFault $fault) { } catch (SoapFault $fault) {
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring); $this->logger->info($fault->faultcode.':'.$fault->faultstring);
return $fault->faultstring; return $fault->faultstring;
} }
} }
@ -539,7 +549,7 @@ class WsScores
$reponse = $client->searchLogin($params); $reponse = $client->searchLogin($params);
return $reponse->searchLoginResult; return $reponse->searchLoginResult;
} catch (SoapFault $fault) { } 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()); $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
return false; return false;
} }
@ -562,7 +572,7 @@ class WsScores
$cache->setBlock($reponse->getCurrencyResult); $cache->setBlock($reponse->getCurrencyResult);
return $reponse->getCurrencyResult; return $reponse->getCurrencyResult;
} catch (SoapFault $fault) { } 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()); $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
return false; return false;
} }
@ -591,7 +601,7 @@ class WsScores
$cache->setBlock($reponse->getCountryResult); $cache->setBlock($reponse->getCountryResult);
return $reponse->getCountryResult; return $reponse->getCountryResult;
} catch (SoapFault $fault) { } 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()); $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
return false; return false;
} }
@ -607,7 +617,7 @@ class WsScores
$reponse = $client->setBourse($params); $reponse = $client->setBourse($params);
return $reponse->setBourseResult; return $reponse->setBourseResult;
} catch (SoapFault $fault) { } 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')) ){ if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
return $fault->faultstring; return $fault->faultstring;
} else { } else {
@ -626,7 +636,7 @@ class WsScores
$reponse = $client->getBourse($params); $reponse = $client->getBourse($params);
return $reponse->getBourseResult; return $reponse->getBourseResult;
} catch (SoapFault $fault) { } 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')) ){ if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
return $fault->faultstring; return $fault->faultstring;
} else { } else {
@ -647,7 +657,7 @@ class WsScores
$reponse = $client->setService($params); $reponse = $client->setService($params);
return $reponse->setServiceResult; return $reponse->setServiceResult;
} catch (SoapFault $fault) { } 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')) ){ if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
return $fault->faultstring; return $fault->faultstring;
} else { } else {
@ -665,10 +675,10 @@ class WsScores
$client = $this->loadClient('gestion'); $client = $this->loadClient('gestion');
try { try {
$reponse = $client->getServiceUsers($params); $reponse = $client->getServiceUsers($params);
Zend_Registry::get('firebug')->info($reponse); $this->logger->info($reponse);
return $reponse->getServiceUsersResult; return $reponse->getServiceUsersResult;
} catch (SoapFault $fault) { } 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')) ){ if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
return $fault->faultstring; return $fault->faultstring;
} else { } else {
@ -687,7 +697,7 @@ class WsScores
$reponse = $client->getServices($params); $reponse = $client->getServices($params);
return $reponse->getServicesResult; return $reponse->getServicesResult;
} catch (SoapFault $fault) { } 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')) ){ if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
return $fault->faultstring; return $fault->faultstring;
} else { } else {
@ -706,7 +716,7 @@ class WsScores
$reponse = $client->getCountryId($params); $reponse = $client->getCountryId($params);
return $reponse->getCountryIdResult; return $reponse->getCountryIdResult;
} catch (SoapFault $fault) { } 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')) ){ if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
return $fault->faultstring; return $fault->faultstring;
} else { } else {
@ -725,7 +735,7 @@ class WsScores
$reponse = $client->getLien($params); $reponse = $client->getLien($params);
return $reponse->getLienResult; return $reponse->getLienResult;
} catch (SoapFault $fault) { } 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')) ){ if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
return $fault->faultstring; return $fault->faultstring;
} else { } else {
@ -746,7 +756,7 @@ class WsScores
$reponse = $client->getLienDoc($params); $reponse = $client->getLienDoc($params);
return $reponse->getLienDocResult; return $reponse->getLienDocResult;
} catch (SoapFault $fault) { } 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()); $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
return false; return false;
} }
@ -762,7 +772,7 @@ class WsScores
$reponse = $client->setLienDoc($params); $reponse = $client->setLienDoc($params);
return $reponse->setLienDocResult; return $reponse->setLienDocResult;
} catch (SoapFault $fault) { } 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()); $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
return false; return false;
} }
@ -778,7 +788,7 @@ class WsScores
$reponse = $client->setLien($params); $reponse = $client->setLien($params);
return $reponse->setLienResult; return $reponse->setLienResult;
} catch (SoapFault $fault) { } 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')) ){ if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
return $fault->faultstring; return $fault->faultstring;
} else { } else {
@ -797,7 +807,7 @@ class WsScores
$reponse = $client->getLienRef($params); $reponse = $client->getLienRef($params);
return $reponse->getLienRefResult; return $reponse->getLienRefResult;
} catch (SoapFault $fault) { } 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')) ){ if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
return $fault->faultstring; return $fault->faultstring;
} else { } else {
@ -816,7 +826,7 @@ class WsScores
$reponse = $client->getLienRef($params); $reponse = $client->getLienRef($params);
return $reponse->getLienRefResult; return $reponse->getLienRefResult;
} catch (SoapFault $fault) { } 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')) ){ if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
return $fault->faultstring; return $fault->faultstring;
} else { } else {
@ -836,7 +846,7 @@ class WsScores
$reponse = $client->setLienRef($params); $reponse = $client->setLienRef($params);
return $reponse->setLienRefResult; return $reponse->setLienRefResult;
} catch (SoapFault $fault) { } 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')) ){ if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
return $fault->faultstring; return $fault->faultstring;
} else { } else {
@ -856,7 +866,7 @@ class WsScores
$reponse = $client->searchLienRef($params); $reponse = $client->searchLienRef($params);
return $reponse->searchLienRefResult; return $reponse->searchLienRefResult;
} catch (SoapFault $fault) { } 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')) ){ if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
return $fault->faultstring; return $fault->faultstring;
} else { } else {
@ -879,7 +889,7 @@ class WsScores
$reponse = $client->setActeAsso($params); $reponse = $client->setActeAsso($params);
return $reponse->setActeAssoResult; return $reponse->setActeAssoResult;
} catch (SoapFault $fault) { } 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')) ){ if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
return $fault->faultstring; return $fault->faultstring;
} else { } else {
@ -908,7 +918,7 @@ class WsScores
$reponse = $client->setBilan($params); $reponse = $client->setBilan($params);
return $reponse->setBilanResult; return $reponse->setBilanResult;
} catch (SoapFault $fault) { } 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')) ){ if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
return $fault->faultstring; return $fault->faultstring;
} else { } else {
@ -938,7 +948,7 @@ class WsScores
$reponse = $client->getBilans($params); $reponse = $client->getBilans($params);
return $reponse->getBilansResult; return $reponse->getBilansResult;
} catch (SoapFault $fault) { } 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()); $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
return false; return false;
} }
@ -963,10 +973,10 @@ class WsScores
$client = $this->loadClient('pieces'); $client = $this->loadClient('pieces');
try { try {
$reponse = $client->getBilan($params); $reponse = $client->getBilan($params);
Zend_Registry::get('firebug')->info($reponse); $this->logger->info($reponse);
return $reponse->getBilanResult; return $reponse->getBilanResult;
} catch (SoapFault $fault) { } 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()); $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
return false; return false;
} }
@ -986,10 +996,10 @@ class WsScores
$client = $this->loadClient('pieces'); $client = $this->loadClient('pieces');
try { try {
$reponse = $client->getActe($params); $reponse = $client->getActe($params);
Zend_Registry::get('firebug')->info($reponse); $this->logger->info($reponse);
return $reponse->getActeResult; return $reponse->getActeResult;
} catch (SoapFault $fault) { } 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()); $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
return false; return false;
} }
@ -1006,7 +1016,7 @@ class WsScores
$reponse = $client->getActes($params); $reponse = $client->getActes($params);
return $reponse->getActesResult; return $reponse->getActesResult;
} catch (SoapFault $fault) { } 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()); $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
return false; return false;
} }
@ -1025,7 +1035,7 @@ class WsScores
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){ if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
return $fault->faultstring; return $fault->faultstring;
} else { } 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()); $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
return false; return false;
} }
@ -1045,7 +1055,7 @@ class WsScores
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){ if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
return $fault->faultstring; return $fault->faultstring;
} else { } 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()); $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
return false; return false;
} }
@ -1065,7 +1075,7 @@ class WsScores
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){ if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
return $fault->faultstring; return $fault->faultstring;
} else { } 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()); $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
return false; return false;
} }
@ -1079,7 +1089,7 @@ class WsScores
$client = $this->loadClient('gestion'); $client = $this->loadClient('gestion');
try { try {
$reponse = $client->setCGU($params); $reponse = $client->setCGU($params);
Zend_Registry::get('firebug')->info($reponse); $this->logger->info($reponse);
return $reponse->setCGUResult; return $reponse->setCGUResult;
} catch(SoapFault $fault) { } catch(SoapFault $fault) {
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse()); $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
@ -1119,7 +1129,7 @@ class WsScores
$client = $this->loadClient('gestion'); $client = $this->loadClient('gestion');
try { try {
$reponse = $client->getEmail($params); $reponse = $client->getEmail($params);
Zend_Registry::get('firebug')->info($reponse); $this->logger->info($reponse);
return $reponse->getEmailResult; return $reponse->getEmailResult;
} catch (SoapFault $fault) { } catch (SoapFault $fault) {
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse()); $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
@ -1229,7 +1239,7 @@ class WsScores
return $reponse->getKbisResult; return $reponse->getKbisResult;
} catch (SoapFault $fault) { } catch (SoapFault $fault) {
if ( in_array($fault->faultcode, array('0000', 'MSG')) ){ 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; return $fault->faultstring;
} else { } else {
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse()); $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
@ -1678,7 +1688,7 @@ class WsScores
$reponse = $client->setMandataire($params); $reponse = $client->setMandataire($params);
return $reponse->setMandataireResult; return $reponse->setMandataireResult;
} catch (SoapFault $fault) { } 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')) ){ if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
return $fault->faultstring; return $fault->faultstring;
} else { } else {
@ -2329,7 +2339,7 @@ class WsScores
$client = $this->loadClient('entreprise'); $client = $this->loadClient('entreprise');
try { try {
$reponse = $client->getAnnoncesLegales($params); $reponse = $client->getAnnoncesLegales($params);
Zend_Registry::get('firebug')->info($reponse); $this->logger->info($reponse);
if ($this->cacheWrite) { if ($this->cacheWrite) {
$cache->deletefile(); $cache->deletefile();
$cache->setBlock($reponse->getAnnoncesLegalesResult); $cache->setBlock($reponse->getAnnoncesLegalesResult);
@ -2689,7 +2699,7 @@ class WsScores
$reponse = $client->setDirigeantsOp($params); $reponse = $client->setDirigeantsOp($params);
return $reponse->setDirigeantsOpResult; return $reponse->setDirigeantsOpResult;
} catch (SoapFault $fault) { } 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')) ){ if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
return $fault->faultstring; return $fault->faultstring;
} else { } else {
@ -2726,7 +2736,7 @@ class WsScores
} }
return $reponse->getAvisRncsResult; return $reponse->getAvisRncsResult;
} catch (SoapFault $fault) { } 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')) ){ if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
return $fault->faultstring; return $fault->faultstring;
} else { } else {
@ -3118,7 +3128,7 @@ class WsScores
return $reponse->setCmdAssoResult; return $reponse->setCmdAssoResult;
} catch (SoapFault $fault) { } catch (SoapFault $fault) {
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse()); $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
Zend_Registry::get('firebug')->info($fault); $this->logger->info($fault);
//Placer exception pour affichage message //Placer exception pour affichage message
return false; return false;
} }
@ -3171,7 +3181,7 @@ class WsScores
return $fault->getMessage(); return $fault->getMessage();
} else { } else {
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse()); $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
Zend_Registry::get('firebug')->info($fault); $this->logger->info($fault);
//Placer exception pour affichage message //Placer exception pour affichage message
return false; return false;
@ -3235,11 +3245,11 @@ class WsScores
try { try {
$client = $this->loadClient('gestion'); $client = $this->loadClient('gestion');
$reponse = $client->getNextLogin($params); $reponse = $client->getNextLogin($params);
Zend_Registry::get('firebug')->info($reponse); $this->logger->info($reponse);
return $reponse->getNextLoginResult; return $reponse->getNextLoginResult;
} catch (SoapFault $fault) { } catch (SoapFault $fault) {
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse()); $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
Zend_Registry::get('firebug')->info($fault); $this->logger->info($fault);
//Placer exception pour affichage message //Placer exception pour affichage message
return false; return false;
} }
@ -3372,7 +3382,7 @@ class WsScores
$message.= "Reponse :\n ".$reponse."\n"; $message.= "Reponse :\n ".$reponse."\n";
if (APPLICATION_ENV == 'development' ) { 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 { } else {
$c = Zend_Registry::get('config'); $c = Zend_Registry::get('config');
$mail = new Scores_Mail_Method(); $mail = new Scores_Mail_Method();