From f19057dcca96a77813f94f24b1edb7cac09aae91 Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Fri, 10 Feb 2017 16:54:29 +0100 Subject: [PATCH 1/8] Add Monolog --- composer.json | 3 +- composer.lock | 127 +++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 128 insertions(+), 2 deletions(-) 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", From af0d43268073d085d20a2cec24d28690813e6ab3 Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Fri, 10 Feb 2017 16:54:46 +0100 Subject: [PATCH 2/8] Monolog in registry --- application/Bootstrap.php | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/application/Bootstrap.php b/application/Bootstrap.php index 2c5185a02..790e49f29 100644 --- a/application/Bootstrap.php +++ b/application/Bootstrap.php @@ -98,6 +98,35 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap Zend_Registry::set('log', $AppLogger); } + /** + * Logs and Debug + */ + protected function _initLogger() + { + $config = new Zend_Config($this->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 */ From 3f814645e5d432d187fcd275685753320f2408d5 Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Mon, 13 Feb 2017 12:02:09 +0100 Subject: [PATCH 3/8] Add logger var --- .../modules/default/controllers/AideController.php | 6 ++++++ .../modules/default/controllers/AuthController.php | 6 ++++++ .../modules/default/controllers/BdfController.php | 6 ++++++ .../default/controllers/DashboardController.php | 6 ++++++ .../default/controllers/DirigeantController.php | 6 ++++++ .../modules/default/controllers/ErrorController.php | 6 ++++++ .../default/controllers/EvaluationController.php | 6 ++++++ .../modules/default/controllers/FinanceController.php | 10 ++++++++-- .../modules/default/controllers/GiantController.php | 7 ++++++- .../modules/default/controllers/IdentiteController.php | 6 ++++++ .../modules/default/controllers/IndexController.php | 6 ++++++ .../default/controllers/JuridiqueController.php | 6 ++++++ .../modules/default/controllers/LogoController.php | 6 ++++++ .../default/controllers/MandataireController.php | 6 ++++++ .../modules/default/controllers/OrderController.php | 6 ++++++ .../modules/default/controllers/PiecesController.php | 6 ++++++ .../modules/default/controllers/PrintController.php | 6 ++++++ .../default/controllers/RechercheController.php | 6 ++++++ .../modules/default/controllers/SaisieController.php | 10 ++++++---- .../default/controllers/SurveillanceController.php | 6 ++++++ .../default/controllers/TelechargementController.php | 6 ++++++ .../modules/default/controllers/UserController.php | 6 ++++++ .../default/controllers/WorldcheckController.php | 6 ++++++ 23 files changed, 140 insertions(+), 7 deletions(-) diff --git a/application/modules/default/controllers/AideController.php b/application/modules/default/controllers/AideController.php index ca027b8a7..47fa01c5a 100644 --- a/application/modules/default/controllers/AideController.php +++ b/application/modules/default/controllers/AideController.php @@ -3,6 +3,12 @@ class AideController extends Zend_Controller_Action { protected $theme; + /** + * Logger + * @var \Monolog\Logger + */ + protected $logger; + public function init() { // --- Theme diff --git a/application/modules/default/controllers/AuthController.php b/application/modules/default/controllers/AuthController.php index 4af345f78..c344942c9 100644 --- a/application/modules/default/controllers/AuthController.php +++ b/application/modules/default/controllers/AuthController.php @@ -14,6 +14,12 @@ class AuthController extends Zend_Controller_Action ) ); + /** + * Logger + * @var \Monolog\Logger + */ + protected $logger; + public function init() { // --- Theme diff --git a/application/modules/default/controllers/BdfController.php b/application/modules/default/controllers/BdfController.php index 14257f7d5..0d0634f92 100644 --- a/application/modules/default/controllers/BdfController.php +++ b/application/modules/default/controllers/BdfController.php @@ -3,6 +3,12 @@ class BdfController extends Zend_Controller_Action { protected $theme; + /** + * Logger + * @var \Monolog\Logger + */ + protected $logger; + public function init() { // --- Theme diff --git a/application/modules/default/controllers/DashboardController.php b/application/modules/default/controllers/DashboardController.php index 07001a534..127eca8df 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 diff --git a/application/modules/default/controllers/DirigeantController.php b/application/modules/default/controllers/DirigeantController.php index 8dc833678..3c2a96ca6 100644 --- a/application/modules/default/controllers/DirigeantController.php +++ b/application/modules/default/controllers/DirigeantController.php @@ -5,6 +5,12 @@ class DirigeantController extends Zend_Controller_Action protected $siret; protected $id; + /** + * Logger + * @var \Monolog\Logger + */ + protected $logger; + public function init() { // --- Theme diff --git a/application/modules/default/controllers/ErrorController.php b/application/modules/default/controllers/ErrorController.php index b60679658..908ffb938 100644 --- a/application/modules/default/controllers/ErrorController.php +++ b/application/modules/default/controllers/ErrorController.php @@ -3,6 +3,12 @@ class ErrorController extends Zend_Controller_Action { protected $theme; + /** + * Logger + * @var \Monolog\Logger + */ + protected $logger; + public function init() { // --- Theme diff --git a/application/modules/default/controllers/EvaluationController.php b/application/modules/default/controllers/EvaluationController.php index 5b15a4bb8..188de15aa 100644 --- a/application/modules/default/controllers/EvaluationController.php +++ b/application/modules/default/controllers/EvaluationController.php @@ -5,6 +5,12 @@ class EvaluationController extends Zend_Controller_Action protected $siret = null; protected $id = 0; + /** + * Logger + * @var \Monolog\Logger + */ + protected $logger; + public function init() { // --- Theme diff --git a/application/modules/default/controllers/FinanceController.php b/application/modules/default/controllers/FinanceController.php index a6607e907..41d2cc29f 100644 --- a/application/modules/default/controllers/FinanceController.php +++ b/application/modules/default/controllers/FinanceController.php @@ -5,6 +5,12 @@ class FinanceController extends Zend_Controller_Action protected $siret = null; protected $id = 0; + /** + * Logger + * @var \Monolog\Logger + */ + protected $logger; + public function init() { // --- Theme @@ -1042,10 +1048,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..c019e78ba 100644 --- a/application/modules/default/controllers/GiantController.php +++ b/application/modules/default/controllers/GiantController.php @@ -40,6 +40,11 @@ class GiantController extends Zend_Controller_Action 'NL' => 'The Netherlands', ); + /** + * Logger + * @var \Monolog\Logger + */ + protected $logger; public function init() { @@ -409,7 +414,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..7af1f0df7 100644 --- a/application/modules/default/controllers/IdentiteController.php +++ b/application/modules/default/controllers/IdentiteController.php @@ -5,6 +5,12 @@ class IdentiteController extends Zend_Controller_Action protected $siret = null; protected $id = 0; + /** + * Logger + * @var \Monolog\Logger + */ + protected $logger; + public function init() { // --- Theme diff --git a/application/modules/default/controllers/IndexController.php b/application/modules/default/controllers/IndexController.php index 23ea45dc2..8c649c555 100644 --- a/application/modules/default/controllers/IndexController.php +++ b/application/modules/default/controllers/IndexController.php @@ -3,6 +3,12 @@ class IndexController extends Zend_Controller_Action { protected $theme; + /** + * Logger + * @var \Monolog\Logger + */ + protected $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..f45d10ad9 100644 --- a/application/modules/default/controllers/JuridiqueController.php +++ b/application/modules/default/controllers/JuridiqueController.php @@ -5,6 +5,12 @@ class JuridiqueController extends Zend_Controller_Action protected $siret = null; protected $id = 0; + /** + * Logger + * @var \Monolog\Logger + */ + protected $logger; + public function init() { // --- Theme diff --git a/application/modules/default/controllers/LogoController.php b/application/modules/default/controllers/LogoController.php index 3fabbf1fa..eb254c883 100644 --- a/application/modules/default/controllers/LogoController.php +++ b/application/modules/default/controllers/LogoController.php @@ -4,6 +4,12 @@ class LogoController extends Zend_Controller_Action protected $theme; protected $pathLogo = ''; + /** + * Logger + * @var \Monolog\Logger + */ + protected $logger; + public function init() { // --- Theme diff --git a/application/modules/default/controllers/MandataireController.php b/application/modules/default/controllers/MandataireController.php index c1cf53cb8..3abfb7619 100644 --- a/application/modules/default/controllers/MandataireController.php +++ b/application/modules/default/controllers/MandataireController.php @@ -54,6 +54,12 @@ 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() { // --- Theme diff --git a/application/modules/default/controllers/OrderController.php b/application/modules/default/controllers/OrderController.php index a50d2d8c4..a694e2587 100644 --- a/application/modules/default/controllers/OrderController.php +++ b/application/modules/default/controllers/OrderController.php @@ -3,6 +3,12 @@ class OrderController extends Zend_Controller_Action { protected $theme; + /** + * Logger + * @var \Monolog\Logger + */ + protected $logger; + public function init() { // --- Theme diff --git a/application/modules/default/controllers/PiecesController.php b/application/modules/default/controllers/PiecesController.php index 8d7bf1472..f9725af90 100644 --- a/application/modules/default/controllers/PiecesController.php +++ b/application/modules/default/controllers/PiecesController.php @@ -18,6 +18,12 @@ class PiecesController extends Zend_Controller_Action protected $siret; protected $id; + /** + * Logger + * @var \Monolog\Logger + */ + protected $logger; + public function init() { // --- Theme diff --git a/application/modules/default/controllers/PrintController.php b/application/modules/default/controllers/PrintController.php index 74dc5493a..9294f4730 100644 --- a/application/modules/default/controllers/PrintController.php +++ b/application/modules/default/controllers/PrintController.php @@ -3,6 +3,12 @@ class PrintController extends Zend_Controller_Action { protected $theme; + /** + * Logger + * @var \Monolog\Logger + */ + protected $logger; + public function init() { // --- Theme diff --git a/application/modules/default/controllers/RechercheController.php b/application/modules/default/controllers/RechercheController.php index 5f2385ec5..2e4f67b16 100644 --- a/application/modules/default/controllers/RechercheController.php +++ b/application/modules/default/controllers/RechercheController.php @@ -3,6 +3,12 @@ class RechercheController extends Zend_Controller_Action { protected $theme; + /** + * Logger + * @var \Monolog\Logger + */ + protected $logger; + public function init() { // --- Theme diff --git a/application/modules/default/controllers/SaisieController.php b/application/modules/default/controllers/SaisieController.php index d542253d2..784983191 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,6 +238,12 @@ class SaisieController extends Zend_Controller_Action 'Societe' => 'STE' ); + /** + * Logger + * @var \Monolog\Logger + */ + protected $logger; + public function init() { // --- Theme diff --git a/application/modules/default/controllers/SurveillanceController.php b/application/modules/default/controllers/SurveillanceController.php index 75707140a..4aedeeb03 100644 --- a/application/modules/default/controllers/SurveillanceController.php +++ b/application/modules/default/controllers/SurveillanceController.php @@ -35,6 +35,12 @@ class SurveillanceController extends Zend_Controller_Action 'liens' => 'survliens', ); + /** + * Logger + * @var \Monolog\Logger + */ + protected $logger; + public function init() { // --- Theme diff --git a/application/modules/default/controllers/TelechargementController.php b/application/modules/default/controllers/TelechargementController.php index 11d3ef3c1..a658dd12f 100644 --- a/application/modules/default/controllers/TelechargementController.php +++ b/application/modules/default/controllers/TelechargementController.php @@ -13,6 +13,12 @@ class TelechargementController extends Zend_Controller_Action */ protected $path = ''; + /** + * Logger + * @var \Monolog\Logger + */ + protected $logger; + public function init() { $this->_helper->layout()->disableLayout(); diff --git a/application/modules/default/controllers/UserController.php b/application/modules/default/controllers/UserController.php index 3c1633388..9be60cee8 100644 --- a/application/modules/default/controllers/UserController.php +++ b/application/modules/default/controllers/UserController.php @@ -28,6 +28,12 @@ class UserController extends Zend_Controller_Action return $new_password; } + /** + * Logger + * @var \Monolog\Logger + */ + protected $logger; + public function init() { // --- Theme diff --git a/application/modules/default/controllers/WorldcheckController.php b/application/modules/default/controllers/WorldcheckController.php index 1ccce3554..b61b16db1 100644 --- a/application/modules/default/controllers/WorldcheckController.php +++ b/application/modules/default/controllers/WorldcheckController.php @@ -4,6 +4,12 @@ class WorldcheckController extends Zend_Controller_Action protected $theme; protected $wcConfig; + /** + * Logger + * @var \Monolog\Logger + */ + protected $logger; + public function init() { // --- Theme From 0c6e07b12c4a9385c7e6f305367ecec1c4686fac Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Mon, 13 Feb 2017 12:06:18 +0100 Subject: [PATCH 4/8] Declare logger --- application/modules/default/controllers/AideController.php | 4 ++++ application/modules/default/controllers/AuthController.php | 4 ++++ application/modules/default/controllers/BdfController.php | 4 ++++ .../modules/default/controllers/DashboardController.php | 4 ++++ .../modules/default/controllers/DirigeantController.php | 4 ++++ .../modules/default/controllers/ErrorController.php | 4 ++++ .../modules/default/controllers/EvaluationController.php | 4 ++++ .../modules/default/controllers/FinanceController.php | 4 ++++ .../modules/default/controllers/GiantController.php | 4 ++++ .../modules/default/controllers/IdentiteController.php | 4 ++++ .../modules/default/controllers/IndexController.php | 7 +++++++ .../modules/default/controllers/JuridiqueController.php | 4 ++++ application/modules/default/controllers/LogoController.php | 4 ++++ .../modules/default/controllers/MandataireController.php | 4 ++++ .../modules/default/controllers/OrderController.php | 4 ++++ .../modules/default/controllers/PiecesController.php | 4 ++++ .../modules/default/controllers/PrintController.php | 4 ++++ .../modules/default/controllers/RechercheController.php | 4 ++++ .../modules/default/controllers/SaisieController.php | 4 ++++ .../modules/default/controllers/SurveillanceController.php | 4 ++++ .../default/controllers/TelechargementController.php | 6 +++++- application/modules/default/controllers/UserController.php | 4 ++++ .../modules/default/controllers/WorldcheckController.php | 4 ++++ 23 files changed, 96 insertions(+), 1 deletion(-) diff --git a/application/modules/default/controllers/AideController.php b/application/modules/default/controllers/AideController.php index 47fa01c5a..53bf9b76e 100644 --- a/application/modules/default/controllers/AideController.php +++ b/application/modules/default/controllers/AideController.php @@ -11,6 +11,10 @@ class AideController 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'); } diff --git a/application/modules/default/controllers/AuthController.php b/application/modules/default/controllers/AuthController.php index c344942c9..f9bb635cc 100644 --- a/application/modules/default/controllers/AuthController.php +++ b/application/modules/default/controllers/AuthController.php @@ -22,6 +22,10 @@ class AuthController 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'); } diff --git a/application/modules/default/controllers/BdfController.php b/application/modules/default/controllers/BdfController.php index 0d0634f92..b31f499ec 100644 --- a/application/modules/default/controllers/BdfController.php +++ b/application/modules/default/controllers/BdfController.php @@ -11,6 +11,10 @@ class BdfController 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'); } diff --git a/application/modules/default/controllers/DashboardController.php b/application/modules/default/controllers/DashboardController.php index 127eca8df..d074b9058 100644 --- a/application/modules/default/controllers/DashboardController.php +++ b/application/modules/default/controllers/DashboardController.php @@ -134,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'); diff --git a/application/modules/default/controllers/DirigeantController.php b/application/modules/default/controllers/DirigeantController.php index 3c2a96ca6..25910f5a1 100644 --- a/application/modules/default/controllers/DirigeantController.php +++ b/application/modules/default/controllers/DirigeantController.php @@ -13,6 +13,10 @@ class DirigeantController 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'); diff --git a/application/modules/default/controllers/ErrorController.php b/application/modules/default/controllers/ErrorController.php index 908ffb938..58e49ddf3 100644 --- a/application/modules/default/controllers/ErrorController.php +++ b/application/modules/default/controllers/ErrorController.php @@ -11,6 +11,10 @@ class ErrorController 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'); } diff --git a/application/modules/default/controllers/EvaluationController.php b/application/modules/default/controllers/EvaluationController.php index 188de15aa..aa2749b46 100644 --- a/application/modules/default/controllers/EvaluationController.php +++ b/application/modules/default/controllers/EvaluationController.php @@ -13,6 +13,10 @@ class EvaluationController 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'); diff --git a/application/modules/default/controllers/FinanceController.php b/application/modules/default/controllers/FinanceController.php index 41d2cc29f..152a9b398 100644 --- a/application/modules/default/controllers/FinanceController.php +++ b/application/modules/default/controllers/FinanceController.php @@ -13,6 +13,10 @@ class FinanceController 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'); diff --git a/application/modules/default/controllers/GiantController.php b/application/modules/default/controllers/GiantController.php index c019e78ba..8f8165a7d 100644 --- a/application/modules/default/controllers/GiantController.php +++ b/application/modules/default/controllers/GiantController.php @@ -48,6 +48,10 @@ class GiantController 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'); diff --git a/application/modules/default/controllers/IdentiteController.php b/application/modules/default/controllers/IdentiteController.php index 7af1f0df7..ef4d4b2be 100644 --- a/application/modules/default/controllers/IdentiteController.php +++ b/application/modules/default/controllers/IdentiteController.php @@ -13,6 +13,10 @@ class IdentiteController 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'); diff --git a/application/modules/default/controllers/IndexController.php b/application/modules/default/controllers/IndexController.php index 8c649c555..8f189d4ec 100644 --- a/application/modules/default/controllers/IndexController.php +++ b/application/modules/default/controllers/IndexController.php @@ -9,6 +9,13 @@ class IndexController extends Zend_Controller_Action */ 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 f45d10ad9..8a54d7003 100644 --- a/application/modules/default/controllers/JuridiqueController.php +++ b/application/modules/default/controllers/JuridiqueController.php @@ -13,6 +13,10 @@ class JuridiqueController 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'); diff --git a/application/modules/default/controllers/LogoController.php b/application/modules/default/controllers/LogoController.php index eb254c883..55132f899 100644 --- a/application/modules/default/controllers/LogoController.php +++ b/application/modules/default/controllers/LogoController.php @@ -12,6 +12,10 @@ class LogoController 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'); diff --git a/application/modules/default/controllers/MandataireController.php b/application/modules/default/controllers/MandataireController.php index 3abfb7619..afbb04631 100644 --- a/application/modules/default/controllers/MandataireController.php +++ b/application/modules/default/controllers/MandataireController.php @@ -62,6 +62,10 @@ class MandataireController 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'); diff --git a/application/modules/default/controllers/OrderController.php b/application/modules/default/controllers/OrderController.php index a694e2587..805308e86 100644 --- a/application/modules/default/controllers/OrderController.php +++ b/application/modules/default/controllers/OrderController.php @@ -11,6 +11,10 @@ class OrderController 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'); } diff --git a/application/modules/default/controllers/PiecesController.php b/application/modules/default/controllers/PiecesController.php index f9725af90..c4383e1fa 100644 --- a/application/modules/default/controllers/PiecesController.php +++ b/application/modules/default/controllers/PiecesController.php @@ -26,6 +26,10 @@ class PiecesController 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'); diff --git a/application/modules/default/controllers/PrintController.php b/application/modules/default/controllers/PrintController.php index 9294f4730..f7131e2ec 100644 --- a/application/modules/default/controllers/PrintController.php +++ b/application/modules/default/controllers/PrintController.php @@ -11,6 +11,10 @@ class PrintController 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'); } diff --git a/application/modules/default/controllers/RechercheController.php b/application/modules/default/controllers/RechercheController.php index 2e4f67b16..d142f15db 100644 --- a/application/modules/default/controllers/RechercheController.php +++ b/application/modules/default/controllers/RechercheController.php @@ -11,6 +11,10 @@ class RechercheController 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'); diff --git a/application/modules/default/controllers/SaisieController.php b/application/modules/default/controllers/SaisieController.php index 784983191..23a7772c9 100644 --- a/application/modules/default/controllers/SaisieController.php +++ b/application/modules/default/controllers/SaisieController.php @@ -246,6 +246,10 @@ class SaisieController 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'); diff --git a/application/modules/default/controllers/SurveillanceController.php b/application/modules/default/controllers/SurveillanceController.php index 4aedeeb03..d462ef05e 100644 --- a/application/modules/default/controllers/SurveillanceController.php +++ b/application/modules/default/controllers/SurveillanceController.php @@ -43,6 +43,10 @@ class SurveillanceController 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'); diff --git a/application/modules/default/controllers/TelechargementController.php b/application/modules/default/controllers/TelechargementController.php index a658dd12f..494257758 100644 --- a/application/modules/default/controllers/TelechargementController.php +++ b/application/modules/default/controllers/TelechargementController.php @@ -21,7 +21,11 @@ class TelechargementController extends Zend_Controller_Action 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'); diff --git a/application/modules/default/controllers/UserController.php b/application/modules/default/controllers/UserController.php index 9be60cee8..ece6c73ad 100644 --- a/application/modules/default/controllers/UserController.php +++ b/application/modules/default/controllers/UserController.php @@ -36,6 +36,10 @@ class UserController 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'); diff --git a/application/modules/default/controllers/WorldcheckController.php b/application/modules/default/controllers/WorldcheckController.php index b61b16db1..9ecc40732 100644 --- a/application/modules/default/controllers/WorldcheckController.php +++ b/application/modules/default/controllers/WorldcheckController.php @@ -12,6 +12,10 @@ class WorldcheckController 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'); From a880dea68dd7aa08ecff4398e6a5cfebefb11fe9 Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Mon, 13 Feb 2017 13:53:40 +0100 Subject: [PATCH 5/8] Add use --- application/Bootstrap.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/application/Bootstrap.php b/application/Bootstrap.php index 790e49f29..6028aaf5f 100644 --- a/application/Bootstrap.php +++ b/application/Bootstrap.php @@ -1,4 +1,9 @@ Date: Mon, 13 Feb 2017 13:53:52 +0100 Subject: [PATCH 6/8] Add logger --- .../default/controllers/AideController.php | 2 +- .../default/controllers/AuthController.php | 2 +- .../default/controllers/BdfController.php | 2 +- .../controllers/DashboardController.php | 6 +-- .../controllers/EvaluationController.php | 2 +- .../default/controllers/FinanceController.php | 2 +- .../controllers/IdentiteController.php | 16 +++---- .../controllers/JuridiqueController.php | 22 ++++----- .../controllers/MandataireController.php | 4 +- .../default/controllers/PiecesController.php | 16 +++---- .../default/controllers/PrintController.php | 2 +- .../controllers/RechercheController.php | 6 +-- .../default/controllers/SaisieController.php | 48 +++++++++---------- .../controllers/SurveillanceController.php | 2 +- .../controllers/TelechargementController.php | 6 +-- .../default/controllers/UserController.php | 10 ++-- 16 files changed, 74 insertions(+), 74 deletions(-) diff --git a/application/modules/default/controllers/AideController.php b/application/modules/default/controllers/AideController.php index 53bf9b76e..721a03bcd 100644 --- a/application/modules/default/controllers/AideController.php +++ b/application/modules/default/controllers/AideController.php @@ -80,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 f9bb635cc..7b5d9ff11 100644 --- a/application/modules/default/controllers/AuthController.php +++ b/application/modules/default/controllers/AuthController.php @@ -106,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($InfosLogin); 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 b31f499ec..29f1bf7e3 100644 --- a/application/modules/default/controllers/BdfController.php +++ b/application/modules/default/controllers/BdfController.php @@ -93,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 d074b9058..441dede58 100644 --- a/application/modules/default/controllers/DashboardController.php +++ b/application/modules/default/controllers/DashboardController.php @@ -792,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($user); $this->view->assign('droits', explode(' ',$options['droits'])); $this->view->assign('prefs', explode(' ',$options['pref'])); @@ -878,7 +878,7 @@ class DashboardController extends Zend_Controller_Action } } - Zend_Registry::get('firebug')->info($output); + $this->logger->info($output); $this->view->assign('output', $output); } @@ -993,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($contrats); $this->view->assign('contrats', $contrats->item); //Liste des services diff --git a/application/modules/default/controllers/EvaluationController.php b/application/modules/default/controllers/EvaluationController.php index aa2749b46..f4812247d 100644 --- a/application/modules/default/controllers/EvaluationController.php +++ b/application/modules/default/controllers/EvaluationController.php @@ -465,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($infos); if ($infos === false) { $this->forward('soap', 'error'); } diff --git a/application/modules/default/controllers/FinanceController.php b/application/modules/default/controllers/FinanceController.php index 152a9b398..33a7c916a 100644 --- a/application/modules/default/controllers/FinanceController.php +++ b/application/modules/default/controllers/FinanceController.php @@ -746,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($result); $this->view->ref = strtoupper($result); $this->view->fileref = $params['siren'] . '_' . $params['format'] . '_' . substr($params['dateCloture'],6,4) . substr($params['dateCloture'],3,2) . diff --git a/application/modules/default/controllers/IdentiteController.php b/application/modules/default/controllers/IdentiteController.php index ef4d4b2be..1319d391b 100644 --- a/application/modules/default/controllers/IdentiteController.php +++ b/application/modules/default/controllers/IdentiteController.php @@ -465,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($infos); if ($infos === false) $this->forward('soap', 'error'); $etabs = $infos->result->item; @@ -531,7 +531,7 @@ class IdentiteController extends Zend_Controller_Action 'gps' => $gps, ); } - Zend_Registry::get('firebug')->info($marks); + $this->logger->info($marks); } $this->view->assign('marks', json_encode($marks)); } @@ -1081,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($result); $this->view->assign('result', $result); $this->view->assign('idFiche', $id); @@ -1497,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($infos); if (count($infos)>0) { $name = $infos['name']; @@ -1545,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($infos); if (count($infos)>0) { $sirenTxt = substr($infos['siren'],0,3).' '.substr($infos['siren'],3,3).' '.substr($infos['siren'],6,3); @@ -1662,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($result); if ($result->nbReponses>0) { $this->view->assign('contacts', $result->result->item); @@ -1726,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($result); if ( $result === false ) { $this->view->assign('error', true); @@ -1905,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($result); if ( $result === false ) { $this->view->assign('error', true); diff --git a/application/modules/default/controllers/JuridiqueController.php b/application/modules/default/controllers/JuridiqueController.php index 8a54d7003..5e13b22ed 100644 --- a/application/modules/default/controllers/JuridiqueController.php +++ b/application/modules/default/controllers/JuridiqueController.php @@ -93,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': @@ -108,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($infos); if ($infos === false) { $this->forward('soap', 'error'); } @@ -169,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($annonces); $this->view->assign('annonces', $annonces); } $this->view->headScript()->appendFile($this->theme->pathScript.'/annonces.js', 'text/javascript'); @@ -245,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($infos); if ($infos === false) { $this->forward('soap', 'error'); } @@ -274,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($ann); $annonce = array( 'Desc' => $objAnnonces->getAnnonceDesc($ann), 'Entree' => $objAnnonces->getAnnonceEntree($ann), @@ -525,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($infos); if( $type=='tri' || $type=='cfe' ) { $i=0; foreach($competences as $comp){ @@ -560,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($conventions); $this->view->assign('conventions', $conventions); $this->view->assign('exportObjet', $infos); } @@ -590,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($infos); } /** @@ -614,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) { @@ -676,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($result); $numWS = array(); if (count($result->item)>0) { foreach ($result->item as $item) { diff --git a/application/modules/default/controllers/MandataireController.php b/application/modules/default/controllers/MandataireController.php index afbb04631..1abbba07e 100644 --- a/application/modules/default/controllers/MandataireController.php +++ b/application/modules/default/controllers/MandataireController.php @@ -86,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($reponse); if ($reponse!==false) { $tabMandataires = json_decode($reponse, true); } else { diff --git a/application/modules/default/controllers/PiecesController.php b/application/modules/default/controllers/PiecesController.php index c4383e1fa..4d3a94b16 100644 --- a/application/modules/default/controllers/PiecesController.php +++ b/application/modules/default/controllers/PiecesController.php @@ -141,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($responses); /* * Construire la réponse pour affichage @@ -509,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."); } } @@ -637,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."); } } @@ -836,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($result); if (count($result->item) > 0) { foreach ($result->item as $item) { - Zend_Registry::get('firebug')->info($item); + $this->logger->info($item); if ( $user->checkPerm('actes') ) { $href = $this->view->url(array('controller'=>'pieces', 'action'=>'associationacte', 'siren'=>$siren, 'date'=> $item->Date), 'default', true); @@ -908,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."); } @@ -936,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($listBilans); $decision = ''; foreach ( $listBilans as $item) { @@ -1017,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 f7131e2ec..adca9994a 100644 --- a/application/modules/default/controllers/PrintController.php +++ b/application/modules/default/controllers/PrintController.php @@ -219,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($elements['params']); $this->view->assign('params', $elements['params']); } diff --git a/application/modules/default/controllers/RechercheController.php b/application/modules/default/controllers/RechercheController.php index d142f15db..ebbaa233e 100644 --- a/application/modules/default/controllers/RechercheController.php +++ b/application/modules/default/controllers/RechercheController.php @@ -296,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($form->getValues()); $c = Zend_Registry::get('config'); $path = $c->profil->path->shared.'/persist/log'; @@ -409,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' ) { @@ -927,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 23a7772c9..06647b63f 100644 --- a/application/modules/default/controllers/SaisieController.php +++ b/application/modules/default/controllers/SaisieController.php @@ -556,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); @@ -949,7 +949,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; @@ -965,9 +965,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; @@ -1362,13 +1362,13 @@ class SaisieController extends Zend_Controller_Action $params['step'] ); - Zend_Registry::get('firebug')->info($response); + $this->logger->info($response); 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', @@ -1400,7 +1400,7 @@ class SaisieController extends Zend_Controller_Action $ws = new WsScores(); - Zend_Registry::get('firebug')->info('createfiche:'.$createFiche); + $this->logger->info('createfiche:'.$createFiche); $id2 = null; @@ -1442,16 +1442,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($result); $rs = $result->raisonSociale; //Override session session if ( intval($result->siren) != 0 ) { @@ -1488,7 +1488,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($infos); if ($type=='actionnaire') { $this->view->assign('id1', $infos['idPar']); @@ -1529,7 +1529,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($infos); if ($type=='actionnaire') { $this->view->assign('id1', $infos['idPar']); @@ -1600,7 +1600,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); } @@ -1631,7 +1631,7 @@ class SaisieController extends Zend_Controller_Action $ws = new WsScores(); $result = $ws->searchLienRef($query, $type); - Zend_Registry::get('firebug')->info($result); + $this->logger->info($result); $output = array(); if (count($result->item)>0) { foreach ($result->item as $item) { @@ -1654,7 +1654,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(); @@ -1809,7 +1809,7 @@ class SaisieController extends Zend_Controller_Action 'bilEE' => $params['bilEE'], ); - Zend_Registry::get('firebug')->info($params); + $this->logger->info($params); $ws = new WsScores(); $idNewLien = $ws->setLienRef(json_encode($infos), $params['idLien']); @@ -1884,7 +1884,7 @@ class SaisieController extends Zend_Controller_Action } } } - Zend_Registry::get('firebug')->info($infos); + $this->logger->info($infos); $idNewLien = $ws->setLien(json_encode($infos), $params['idLien']); @@ -2147,7 +2147,7 @@ class SaisieController extends Zend_Controller_Action $ws = new WsScores(); $result = $ws->getIdentite($siren); - Zend_Registry::get('firebug')->info($result); + $this->logger->info($result); $this->view->assign('nom',$result->Nom); $this->view->assign('sigle',$result->sigle); @@ -2218,8 +2218,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($items); //Get country code if ($items->adresse_pays!='FRA') { @@ -2227,7 +2227,7 @@ class SaisieController extends Zend_Controller_Action $this->view->assign('identifiant', $result->item); } - Zend_Registry::get('firebug')->info($items); + $this->logger->info($items); if (count($items)>0) { foreach( $items as $key => $val ) { @@ -2352,7 +2352,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 { @@ -2719,7 +2719,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($data); $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']); @@ -2876,7 +2876,7 @@ class SaisieController extends Zend_Controller_Action if ( $request->isXmlHttpRequest() ) { $this->_helper->layout()->disableLayout(); } - Zend_Registry::get('firebug')->info($request->getParams()); + $this->logger->info($request->getParams()); $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 d462ef05e..279888f11 100644 --- a/application/modules/default/controllers/SurveillanceController.php +++ b/application/modules/default/controllers/SurveillanceController.php @@ -249,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($infos); 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 494257758..fb79b36be 100644 --- a/application/modules/default/controllers/TelechargementController.php +++ b/application/modules/default/controllers/TelechargementController.php @@ -268,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'); @@ -311,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 ece6c73ad..5b0a82f45 100644 --- a/application/modules/default/controllers/UserController.php +++ b/application/modules/default/controllers/UserController.php @@ -101,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($options); $reponse = $ws->setInfosLogin($login, $action, $options); - Zend_Registry::get('firebug')->info($response); + $this->logger->info($response); $isProfilUpdated = true; $message = 'Erreur lors de la mise à jour du compte !'; @@ -487,7 +487,7 @@ class UserController extends Zend_Controller_Action //Auth error else { $this->view->message = ''; - Zend_Registry::get('firebug')->info($result); + $this->logger->info($result); foreach ($result->getMessages() as $message) { $this->view->message.= $message."
"; } @@ -496,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'); } } From cc4592eddd997fc820adaf99f04620552d43b222 Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Mon, 13 Feb 2017 14:08:23 +0100 Subject: [PATCH 7/8] Logger --- .../Application/Controller/Plugin/Auth.php | 18 ++- library/Application/Controller/Plugin/Cgu.php | 8 +- .../Application/Controller/Plugin/Lang.php | 8 +- .../Application/Controller/Plugin/Menu.php | 8 +- library/Application/Controller/Plugin/Pdf.php | 8 +- .../Application/Controller/Plugin/Theme.php | 8 +- library/Application/Controller/Plugin/Xml.php | 8 +- library/Infogreffe/Infogreffe.php | 18 +-- library/Scores/Auth/Adapter/Ws.php | 18 ++- library/Scores/Google/Streetview.php | 4 +- library/Scores/IdentiteProcol.php | 14 ++- library/Scores/RapportComment.php | 28 +++-- library/Scores/Session/Entreprise.php | 12 +- library/Scores/Utilisateur.php | 14 ++- library/Scores/Ws/Client.php | 24 ++-- library/Scores/WsScores.php | 118 ++++++++++-------- 16 files changed, 210 insertions(+), 106 deletions(-) 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..f4b790f81 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($result); $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($acte); 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..6adc74580 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($InfosLogin); // --- 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..a81ef9f24 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($this->annonces); $this->view = new Zend_View(); } diff --git a/library/Scores/RapportComment.php b/library/Scores/RapportComment.php index 97519d8cf..9db9e7ce9 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($matches); $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($this->ratiosEntrep); // --- 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..86c833fcf 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($methodConfig); // --- 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($arguments); } 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($response); } // --- 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..8f956eb50 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($reponse); 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($reponse); 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($reponse); 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($reponse); 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($reponse); 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($reponse); 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($fault); //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($fault); //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($reponse); return $reponse->getNextLoginResult; } catch (SoapFault $fault) { $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse()); - Zend_Registry::get('firebug')->info($fault); + $this->logger->info($fault); //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(); From b8cd36c2a2235c29afa8ed12c65fb01e463ce686 Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Mon, 13 Feb 2017 16:56:06 +0100 Subject: [PATCH 8/8] Fix var type for logger --- .../default/controllers/AuthController.php | 2 +- .../controllers/DashboardController.php | 6 ++--- .../controllers/EvaluationController.php | 2 +- .../default/controllers/FinanceController.php | 2 +- .../controllers/IdentiteController.php | 16 ++++++------- .../controllers/JuridiqueController.php | 16 ++++++------- .../controllers/MandataireController.php | 2 +- .../default/controllers/PiecesController.php | 8 +++---- .../default/controllers/PrintController.php | 2 +- .../controllers/RechercheController.php | 2 +- .../default/controllers/SaisieController.php | 24 +++++++++---------- .../controllers/SurveillanceController.php | 2 +- .../default/controllers/UserController.php | 6 ++--- library/Infogreffe/Infogreffe.php | 4 ++-- library/Scores/Auth/Adapter/Ws.php | 2 +- library/Scores/IdentiteProcol.php | 2 +- library/Scores/RapportComment.php | 4 ++-- library/Scores/Ws/Client.php | 6 ++--- library/Scores/WsScores.php | 20 ++++++++-------- 19 files changed, 63 insertions(+), 65 deletions(-) diff --git a/application/modules/default/controllers/AuthController.php b/application/modules/default/controllers/AuthController.php index 7b5d9ff11..966e03173 100644 --- a/application/modules/default/controllers/AuthController.php +++ b/application/modules/default/controllers/AuthController.php @@ -106,7 +106,7 @@ class AuthController extends Zend_Controller_Action try { $ws = new Scores_Ws_Client('gestion', '0.3'); $InfosLogin = $ws->getInfosLogin($parameters); - $this->logger->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/DashboardController.php b/application/modules/default/controllers/DashboardController.php index 441dede58..c29638cb5 100644 --- a/application/modules/default/controllers/DashboardController.php +++ b/application/modules/default/controllers/DashboardController.php @@ -792,7 +792,7 @@ class DashboardController extends Zend_Controller_Action $user = $ws->getUser($login); $options = json_decode($user, true); - $this->logger->info($user); + $this->logger->info(print_r($user,1)); $this->view->assign('droits', explode(' ',$options['droits'])); $this->view->assign('prefs', explode(' ',$options['pref'])); @@ -878,7 +878,7 @@ class DashboardController extends Zend_Controller_Action } } - $this->logger->info($output); + $this->logger->info(print_r($output,1)); $this->view->assign('output', $output); } @@ -993,7 +993,7 @@ class DashboardController extends Zend_Controller_Action //Liste des periodes de facturation $contrats = $ws->getClientTarifs($idClient); - $this->logger->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/EvaluationController.php b/application/modules/default/controllers/EvaluationController.php index f4812247d..17749c17b 100644 --- a/application/modules/default/controllers/EvaluationController.php +++ b/application/modules/default/controllers/EvaluationController.php @@ -465,7 +465,7 @@ class EvaluationController extends Zend_Controller_Action $email = $request->getParam('email', ''); $infos = $ws->getRapport($siren, 3, 0, $plus, $ref, $encours, $email); - $this->logger->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 33a7c916a..6f17ea933 100644 --- a/application/modules/default/controllers/FinanceController.php +++ b/application/modules/default/controllers/FinanceController.php @@ -746,7 +746,7 @@ class FinanceController extends Zend_Controller_Action if ($result === false) { $this->view->msg = "Erreur lors de l'enregistrement des informations"; } else { - $this->logger->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) . diff --git a/application/modules/default/controllers/IdentiteController.php b/application/modules/default/controllers/IdentiteController.php index 1319d391b..83647e030 100644 --- a/application/modules/default/controllers/IdentiteController.php +++ b/application/modules/default/controllers/IdentiteController.php @@ -465,7 +465,7 @@ class IdentiteController extends Zend_Controller_Action $ws = new WsScores(); $infos = $ws->getEtablissementsGeo($siren, $actif, $position, $nbAffichage); - $this->logger->info($infos); + $this->logger->info(print_r($infos,1)); if ($infos === false) $this->forward('soap', 'error'); $etabs = $infos->result->item; @@ -531,7 +531,7 @@ class IdentiteController extends Zend_Controller_Action 'gps' => $gps, ); } - $this->logger->info($marks); + $this->logger->info(print_r($marks,1)); } $this->view->assign('marks', json_encode($marks)); } @@ -1081,7 +1081,7 @@ class IdentiteController extends Zend_Controller_Action $ws = new WsScores(); $result = $ws->getLienRef($id); - $this->logger->info($result); + $this->logger->info(print_r($result,1)); $this->view->assign('result', $result); $this->view->assign('idFiche', $id); @@ -1497,7 +1497,7 @@ class IdentiteController extends Zend_Controller_Action $result = $ws->getGroupesArbo($siren, $pctMin, 10, $stopAtIsin); if ( $result!==false ) { $infos = json_decode($result, true); - $this->logger->info($infos); + $this->logger->info(print_r($infos,1)); if (count($infos)>0) { $name = $infos['name']; @@ -1545,7 +1545,7 @@ class IdentiteController extends Zend_Controller_Action if ( $result!==false ) { $infos = json_decode($result, true); - $this->logger->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); @@ -1662,7 +1662,7 @@ class IdentiteController extends Zend_Controller_Action $ws = new WsScores(); $result = $ws->getContactEt($companyId, $filter); - $this->logger->info($result); + $this->logger->info(print_r($result,1)); if ($result->nbReponses>0) { $this->view->assign('contacts', $result->result->item); @@ -1726,7 +1726,7 @@ class IdentiteController extends Zend_Controller_Action $ws = new WsScores(); $result = $ws->getEntrepriseAvisRncs($siren); - $this->logger->info($result); + $this->logger->info(print_r($result,1)); if ( $result === false ) { $this->view->assign('error', true); @@ -1905,7 +1905,7 @@ class IdentiteController extends Zend_Controller_Action $ws = new WsScores(); $result = $ws->getEntrepriseAvisRncs($siren); - $this->logger->info($result); + $this->logger->info(print_r($result,1)); if ( $result === false ) { $this->view->assign('error', true); diff --git a/application/modules/default/controllers/JuridiqueController.php b/application/modules/default/controllers/JuridiqueController.php index 5e13b22ed..e19178aa5 100644 --- a/application/modules/default/controllers/JuridiqueController.php +++ b/application/modules/default/controllers/JuridiqueController.php @@ -108,7 +108,7 @@ class JuridiqueController extends Zend_Controller_Action $infos = $ws->getAnnoncesLegales($siren, $idAnn, null, $position, $nbAffichage); break; } - $this->logger->info($infos); + $this->logger->info(print_r($infos,1)); if ($infos === false) { $this->forward('soap', 'error'); } @@ -169,7 +169,7 @@ class JuridiqueController extends Zend_Controller_Action foreach($objAnnonces->$classType as $ann) { $annonces[] = $objAnnonces->getAnnonceResume($ann); } - $this->logger->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'); @@ -245,7 +245,7 @@ class JuridiqueController extends Zend_Controller_Action $infos = $ws->getAnnoncesLegales($siren, $idAnn, null, $position, $nbAffichage); break; } - $this->logger->info($infos); + $this->logger->info(print_r($infos,1)); if ($infos === false) { $this->forward('soap', 'error'); } @@ -274,7 +274,7 @@ class JuridiqueController extends Zend_Controller_Action foreach($objAnnonces->$classType as $ann) { if($ann->id==$idAnn) break; } - $this->logger->info($ann); + $this->logger->info(print_r($ann,1)); $annonce = array( 'Desc' => $objAnnonces->getAnnonceDesc($ann), 'Entree' => $objAnnonces->getAnnonceEntree($ann), @@ -525,7 +525,7 @@ class JuridiqueController extends Zend_Controller_Action if ($infos === false) $this->_forward('soap', 'error'); $competences = $infos->result->item; - $this->logger->info($infos); + $this->logger->info(print_r($infos,1)); if( $type=='tri' || $type=='cfe' ) { $i=0; foreach($competences as $comp){ @@ -560,7 +560,7 @@ class JuridiqueController extends Zend_Controller_Action $ws = new WsScores(); $infos = $ws->getListeConventions($siren); $conventions = $infos->result->item; - $this->logger->info($conventions); + $this->logger->info(print_r($conventions,1)); $this->view->assign('conventions', $conventions); $this->view->assign('exportObjet', $infos); } @@ -590,7 +590,7 @@ class JuridiqueController extends Zend_Controller_Action $this->view->assign('marques', $marques); $this->view->assign('idObject', $idObject); $this->view->assign('exportObjet', $marques); - $this->logger->info($infos); + $this->logger->info(print_r($infos,1)); } /** @@ -676,7 +676,7 @@ class JuridiqueController extends Zend_Controller_Action $ws = new WsScores(); $result = $ws->getAnnoncesNum($siren); - $this->logger->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/MandataireController.php b/application/modules/default/controllers/MandataireController.php index 1abbba07e..3bd250911 100644 --- a/application/modules/default/controllers/MandataireController.php +++ b/application/modules/default/controllers/MandataireController.php @@ -92,7 +92,7 @@ class MandataireController extends Zend_Controller_Action if ($idMandataire != '') { $idMandataire = (int)substr($idMandataire,1); $reponse = $ws->getMandataire($idMandataire); - $this->logger->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/PiecesController.php b/application/modules/default/controllers/PiecesController.php index 4d3a94b16..b347020ac 100644 --- a/application/modules/default/controllers/PiecesController.php +++ b/application/modules/default/controllers/PiecesController.php @@ -141,7 +141,7 @@ class PiecesController extends Zend_Controller_Action //Affichage des actes disponible $ws = new WsScores(); $responses = $ws->getPiecesActes($siren); - $this->logger->info($responses); + $this->logger->info(print_r($responses,1)); /* * Construire la réponse pour affichage @@ -836,10 +836,10 @@ class PiecesController extends Zend_Controller_Action $params->companyId = $siren; $result = $ws->getAssoActes($params); $actes = array(); - $this->logger->info($result); + $this->logger->info(print_r($result,1)); if (count($result->item) > 0) { foreach ($result->item as $item) { - $this->logger->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); @@ -936,7 +936,7 @@ class PiecesController extends Zend_Controller_Action $ws = new WsScores(); $reponse = $ws->getPiecesBilans($siren); $listBilans = $reponse->result->item; - $this->logger->info($listBilans); + $this->logger->info(print_r($listBilans,1)); $decision = ''; foreach ( $listBilans as $item) { diff --git a/application/modules/default/controllers/PrintController.php b/application/modules/default/controllers/PrintController.php index adca9994a..66b0fb5db 100644 --- a/application/modules/default/controllers/PrintController.php +++ b/application/modules/default/controllers/PrintController.php @@ -219,7 +219,7 @@ class PrintController extends Zend_Controller_Action } $this->view->assign('controller', $elements['controller']); $this->view->assign('action', $elements['action']); - $this->logger->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 ebbaa233e..5549a0bce 100644 --- a/application/modules/default/controllers/RechercheController.php +++ b/application/modules/default/controllers/RechercheController.php @@ -296,7 +296,7 @@ class RechercheController extends Zend_Controller_Action $request = $this->getRequest(); if ($request->isPost() && $form->isValid($request->getParams())) { - $this->logger->info($form->getValues()); + $this->logger->info(print_r($form->getValues(),1)); $c = Zend_Registry::get('config'); $path = $c->profil->path->shared.'/persist/log'; diff --git a/application/modules/default/controllers/SaisieController.php b/application/modules/default/controllers/SaisieController.php index 06647b63f..f91ee6b83 100644 --- a/application/modules/default/controllers/SaisieController.php +++ b/application/modules/default/controllers/SaisieController.php @@ -1362,7 +1362,7 @@ class SaisieController extends Zend_Controller_Action $params['step'] ); - $this->logger->info($response); + $this->logger->info(print_r($response,1)); if (is_int($response)) { $this->view->assign('result', array('status'=>'OK')); @@ -1451,7 +1451,7 @@ class SaisieController extends Zend_Controller_Action if ( $lienRef !== null ) { $this->logger->info('lienRef:'.$lienRef); $result = $ws->getLienRef($lienRef); - $this->logger->info($result); + $this->logger->info(print_r($result,1)); $rs = $result->raisonSociale; //Override session session if ( intval($result->siren) != 0 ) { @@ -1488,7 +1488,7 @@ class SaisieController extends Zend_Controller_Action $result = $ws->getSaisieLien($idLien); $infos = json_decode($result, true); - $this->logger->info($infos); + $this->logger->info(print_r($infos,1)); if ($type=='actionnaire') { $this->view->assign('id1', $infos['idPar']); @@ -1529,7 +1529,7 @@ class SaisieController extends Zend_Controller_Action $result = $ws->getSaisieLien($idLien); $infos = json_decode($result, true); - $this->logger->info($infos); + $this->logger->info(print_r($infos,1)); if ($type=='actionnaire') { $this->view->assign('id1', $infos['idPar']); @@ -1631,7 +1631,7 @@ class SaisieController extends Zend_Controller_Action $ws = new WsScores(); $result = $ws->searchLienRef($query, $type); - $this->logger->info($result); + $this->logger->info(print_r($result,1)); $output = array(); if (count($result->item)>0) { foreach ($result->item as $item) { @@ -1809,7 +1809,7 @@ class SaisieController extends Zend_Controller_Action 'bilEE' => $params['bilEE'], ); - $this->logger->info($params); + $this->logger->info(print_r($params,1)); $ws = new WsScores(); $idNewLien = $ws->setLienRef(json_encode($infos), $params['idLien']); @@ -1884,7 +1884,7 @@ class SaisieController extends Zend_Controller_Action } } } - $this->logger->info($infos); + $this->logger->info(print_r($infos,1)); $idNewLien = $ws->setLien(json_encode($infos), $params['idLien']); @@ -2147,7 +2147,7 @@ class SaisieController extends Zend_Controller_Action $ws = new WsScores(); $result = $ws->getIdentite($siren); - $this->logger->info($result); + $this->logger->info(print_r($result,1)); $this->view->assign('nom',$result->Nom); $this->view->assign('sigle',$result->sigle); @@ -2219,7 +2219,7 @@ class SaisieController extends Zend_Controller_Action $items = json_decode($result, true); if ( $items!==null ) { $this->logger->info('getSaisieLienRef id='.$id); - $this->logger->info($items); + $this->logger->info(print_r($items,1)); //Get country code if ($items->adresse_pays!='FRA') { @@ -2227,8 +2227,6 @@ class SaisieController extends Zend_Controller_Action $this->view->assign('identifiant', $result->item); } - $this->logger->info($items); - if (count($items)>0) { foreach( $items as $key => $val ) { switch ($key) { @@ -2719,7 +2717,7 @@ class SaisieController extends Zend_Controller_Action $ws = new WsScores(); $result = $ws->getSaisieContactEt($id); $data = json_decode($result, true); - $this->logger->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']); @@ -2876,7 +2874,7 @@ class SaisieController extends Zend_Controller_Action if ( $request->isXmlHttpRequest() ) { $this->_helper->layout()->disableLayout(); } - $this->logger->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 279888f11..cdd08d60c 100644 --- a/application/modules/default/controllers/SurveillanceController.php +++ b/application/modules/default/controllers/SurveillanceController.php @@ -249,7 +249,7 @@ class SurveillanceController extends Zend_Controller_Action $filtre->detail = false; $infos = $ws->getSurveillances($filtre); - $this->logger->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/UserController.php b/application/modules/default/controllers/UserController.php index 5b0a82f45..b62ec9609 100644 --- a/application/modules/default/controllers/UserController.php +++ b/application/modules/default/controllers/UserController.php @@ -102,9 +102,9 @@ class UserController extends Zend_Controller_Action } $ws = new WsScores(); $this->logger->info('setInfosLogin'); - $this->logger->info($options); + $this->logger->info(print_r($options,1)); $reponse = $ws->setInfosLogin($login, $action, $options); - $this->logger->info($response); + $this->logger->info(print_r($response,1)); $isProfilUpdated = true; $message = 'Erreur lors de la mise à jour du compte !'; @@ -487,7 +487,7 @@ class UserController extends Zend_Controller_Action //Auth error else { $this->view->message = ''; - $this->logger->info($result); + $this->logger->info(print_r($result)); foreach ($result->getMessages() as $message) { $this->view->message.= $message."
"; } diff --git a/library/Infogreffe/Infogreffe.php b/library/Infogreffe/Infogreffe.php index f4b790f81..07a39bdb3 100644 --- a/library/Infogreffe/Infogreffe.php +++ b/library/Infogreffe/Infogreffe.php @@ -631,12 +631,12 @@ class Infogreffe $this->logger->info('Detect fichier : '.$sql->__toString()); $result = $actesM->fetchRow($sql); if ( null !== $result ) { - $this->logger->info($result); + $this->logger->info(print_r($result,1)); $fichier = $this->pathData.$this->actePath($ref).$result->file; $this->logger->info($fichier); if ( file_exists($fichier) ) { - $this->logger->info($acte); + $this->logger->info(print_r($acte,1)); if ($result->type != $acte['type_acte'] && $result->type2 == '') { $this->logger->info('Update Database'); //Add to the database diff --git a/library/Scores/Auth/Adapter/Ws.php b/library/Scores/Auth/Adapter/Ws.php index 6adc74580..b1b079b57 100644 --- a/library/Scores/Auth/Adapter/Ws.php +++ b/library/Scores/Auth/Adapter/Ws.php @@ -96,7 +96,7 @@ class Scores_Auth_Adapter_Ws implements Zend_Auth_Adapter_Interface $InfosLogin = $ws->getInfosLogin($parameters); $this->logger->info(__CLASS__ . ' : '.__METHOD__); - $this->logger->info($InfosLogin); + $this->logger->info(print_r($InfosLogin,1)); // --- Renvoi if ( is_string($InfosLogin) || $InfosLogin->error->errnum != 0 ) { $message = $InfosLogin; diff --git a/library/Scores/IdentiteProcol.php b/library/Scores/IdentiteProcol.php index a81ef9f24..91457d156 100644 --- a/library/Scores/IdentiteProcol.php +++ b/library/Scores/IdentiteProcol.php @@ -49,7 +49,7 @@ class IdentiteProcol } } } - $this->logger->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 9db9e7ce9..a8e047350 100644 --- a/library/Scores/RapportComment.php +++ b/library/Scores/RapportComment.php @@ -322,7 +322,7 @@ class RapportComment //Récupération des couleurs $pattern = '/([a-z0-9]{3,4})/i'; if ( preg_match_all($pattern, $listeCouleurs, $matches) ) { - $this->logger->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]]; @@ -507,7 +507,7 @@ class RapportComment $this->logger->info('Histo - id : '.$id); $this->logger->info('Histo - titre : '.$titre); $this->logger->info('Histo - strRatios : '.$strRatios); - $this->logger->info($this->ratiosEntrep); + $this->logger->info(print_r($this->ratiosEntrep,1)); // --- Gestion des couleurs if(count($this->graphCouleurs)>0){ $couleurs = $this->graphCouleurs; diff --git a/library/Scores/Ws/Client.php b/library/Scores/Ws/Client.php index 86c833fcf..991baedfd 100644 --- a/library/Scores/Ws/Client.php +++ b/library/Scores/Ws/Client.php @@ -147,7 +147,7 @@ class Scores_Ws_Client extends Zend_Soap_Client } $methodConfig = $this->config[$name]; - $this->logger->info($methodConfig); + $this->logger->info(print_r($methodConfig,1)); // --- Cache $cacheEnable = false; if ( array_key_exists('cache', $methodConfig) ) { @@ -173,7 +173,7 @@ class Scores_Ws_Client extends Zend_Soap_Client // --- Debug if ( array_key_exists('debug', $methodConfig) ) { $this->logger->info(__CLASS__.'->'.$name); - $this->logger->info($arguments); + $this->logger->info(print_r($arguments,1)); } try { @@ -182,7 +182,7 @@ class Scores_Ws_Client extends Zend_Soap_Client // --- Debug if ( array_key_exists('debug', $methodConfig) ) { - $this->logger->info($response); + $this->logger->info(print_r($response,1)); } // --- Cache diff --git a/library/Scores/WsScores.php b/library/Scores/WsScores.php index 8f956eb50..bea3960d0 100644 --- a/library/Scores/WsScores.php +++ b/library/Scores/WsScores.php @@ -675,7 +675,7 @@ class WsScores $client = $this->loadClient('gestion'); try { $reponse = $client->getServiceUsers($params); - $this->logger->info($reponse); + $this->logger->info(print_r($reponse,1)); return $reponse->getServiceUsersResult; } catch (SoapFault $fault) { $this->logger->info($fault->faultcode.':'.$fault->faultstring); @@ -973,7 +973,7 @@ class WsScores $client = $this->loadClient('pieces'); try { $reponse = $client->getBilan($params); - $this->logger->info($reponse); + $this->logger->info(print_r($reponse,1)); return $reponse->getBilanResult; } catch (SoapFault $fault) { $this->logger->info($fault->faultcode.':'.$fault->faultstring); @@ -996,7 +996,7 @@ class WsScores $client = $this->loadClient('pieces'); try { $reponse = $client->getActe($params); - $this->logger->info($reponse); + $this->logger->info(print_r($reponse,1)); return $reponse->getActeResult; } catch (SoapFault $fault) { $this->logger->info($fault->faultcode.':'.$fault->faultstring); @@ -1089,7 +1089,7 @@ class WsScores $client = $this->loadClient('gestion'); try { $reponse = $client->setCGU($params); - $this->logger->info($reponse); + $this->logger->info(print_r($reponse,1)); return $reponse->setCGUResult; } catch(SoapFault $fault) { $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse()); @@ -1129,7 +1129,7 @@ class WsScores $client = $this->loadClient('gestion'); try { $reponse = $client->getEmail($params); - $this->logger->info($reponse); + $this->logger->info(print_r($reponse,1)); return $reponse->getEmailResult; } catch (SoapFault $fault) { $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse()); @@ -2339,7 +2339,7 @@ class WsScores $client = $this->loadClient('entreprise'); try { $reponse = $client->getAnnoncesLegales($params); - $this->logger->info($reponse); + $this->logger->info(print_r($reponse,1)); if ($this->cacheWrite) { $cache->deletefile(); $cache->setBlock($reponse->getAnnoncesLegalesResult); @@ -3128,7 +3128,7 @@ class WsScores return $reponse->setCmdAssoResult; } catch (SoapFault $fault) { $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse()); - $this->logger->info($fault); + $this->logger->info(print_r($fault,1)); //Placer exception pour affichage message return false; } @@ -3181,7 +3181,7 @@ class WsScores return $fault->getMessage(); } else { $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse()); - $this->logger->info($fault); + $this->logger->info(print_r($fault,1)); //Placer exception pour affichage message return false; @@ -3245,11 +3245,11 @@ class WsScores try { $client = $this->loadClient('gestion'); $reponse = $client->getNextLogin($params); - $this->logger->info($reponse); + $this->logger->info(print_r($reponse,1)); return $reponse->getNextLoginResult; } catch (SoapFault $fault) { $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse()); - $this->logger->info($fault); + $this->logger->info(print_r($fault,1)); //Placer exception pour affichage message return false; }