From f564411480af061d4034371b4724616f91af4484 Mon Sep 17 00:00:00 2001 From: Alexander Demidov Date: Wed, 26 Jun 2013 11:49:27 +0400 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=B4=D0=B0=D0=BB=D0=B5=D0=BD=D0=BE=20?= =?UTF-8?q?=D0=B8=D1=81=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20ErrorMessage=20-=20=D0=BF=D1=80=D0=B8?= =?UTF-8?q?=D0=B2=D1=8F=D0=B7=D0=B0=D0=BD=20=D1=81=D0=B2=D0=BE=D0=B9=20?= =?UTF-8?q?=D0=BB=D0=BE=D0=B3=D0=B3=D0=B5=D1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- File.class.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/File.class.php b/File.class.php index 4efebe2..81d2d05 100644 --- a/File.class.php +++ b/File.class.php @@ -11,7 +11,16 @@ abstract class File { public $path; + public $filename; + + public $logger; + + public function __construct() + { + $this->logger = Logger::getInstance(); + } + /** * @param array|string|null $data * @return Image @@ -24,8 +33,7 @@ abstract class File if (!is_array($data)) { $data = json_decode($data, true); if (json_last_error() != JSON_ERROR_NONE) { - //TODO: подумать над тем, чтобы субмодуль не был связан с классом приложения - вынести отдельно логгер для этого класса - ErrorMessage::log('Unable to convert json-string to array. Data ' . print_r($data, true)); + $instance->logger->log('Unable to convert json-string to array. Data ' . print_r($data, true)); } } if (is_array($data)) {