summaryrefslogtreecommitdiffstats
path: root/businesslayer
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2014-05-13 20:14:00 +0200
committerBernhard Posselt <dev@bernhard-posselt.com>2014-05-13 20:14:00 +0200
commitf82b818bdb852f63fdb4a431808f37902f4272ff (patch)
tree60e23d0b4b95a5f862661f3ad4fcc8cfa21f076f /businesslayer
parentc9c7b457a09ed3f1899099bba60dad21ff6ad026 (diff)
break all the things!
Diffstat (limited to 'businesslayer')
-rw-r--r--businesslayer/businesslayer.php5
-rw-r--r--businesslayer/feedbusinesslayer.php29
-rw-r--r--businesslayer/folderbusinesslayer.php4
-rw-r--r--businesslayer/itembusinesslayer.php9
4 files changed, 30 insertions, 17 deletions
diff --git a/businesslayer/businesslayer.php b/businesslayer/businesslayer.php
index ea03db1af..dc6fc1a68 100644
--- a/businesslayer/businesslayer.php
+++ b/businesslayer/businesslayer.php
@@ -13,8 +13,9 @@
namespace OCA\News\BusinessLayer;
-use \OCA\News\Db\DoesNotExistException;
-use \OCA\News\Db\MultipleObjectsReturnedException;
+use \OCP\AppFramework\Db\DoesNotExistException;
+use \OCP\AppFramework\Db\MultipleObjectsReturnedException;
+
use \OCA\News\Db\IMapper;
diff --git a/businesslayer/feedbusinesslayer.php b/businesslayer/feedbusinesslayer.php
index 024c7b8ea..acb999aa4 100644
--- a/businesslayer/feedbusinesslayer.php
+++ b/businesslayer/feedbusinesslayer.php
@@ -12,8 +12,11 @@
*/
namespace OCA\News\BusinessLayer;
-use \OCA\News\Core\Logger;
-use \OCA\News\Db\DoesNotExistException;
+
+use \OCP\ILogger;
+use \OCP\IL10N;
+use \OCP\AppFramework\Db\DoesNotExistException;
+
use \OCA\News\Db\Feed;
use \OCA\News\Db\Item;
use \OCA\News\Db\FeedMapper;
@@ -35,16 +38,18 @@ class FeedBusinessLayer extends BusinessLayer {
private $autoPurgeMinimumInterval;
private $enhancer;
private $purifier;
+ private $loggerParams;
public function __construct(FeedMapper $feedMapper,
Fetcher $feedFetcher,
ItemMapper $itemMapper,
- Logger $logger,
- $l10n,
+ ILogger $logger,
+ IL10N $l10n,
$timeFactory,
Config $config,
Enhancer $enhancer,
- $purifier){
+ $purifier,
+ $loggerParams){
parent::__construct($feedMapper);
$this->feedFetcher = $feedFetcher;
$this->itemMapper = $itemMapper;
@@ -55,6 +60,7 @@ class FeedBusinessLayer extends BusinessLayer {
$this->enhancer = $enhancer;
$this->purifier = $purifier;
$this->feedMapper = $feedMapper;
+ $this->loggerParams = $loggerParams;
}
/**
@@ -131,7 +137,7 @@ class FeedBusinessLayer extends BusinessLayer {
return $feed;
} catch(FetcherException $ex){
- $this->logger->log($ex->getMessage(), 'debug');
+ $this->logger->debug($ex->getMessage(), $this->loggerParams);
throw new BusinessLayerException(
$this->l10n->t(
'Can not add feed: URL does not exist, SSL Certificate can not be validated ' .
@@ -150,8 +156,8 @@ class FeedBusinessLayer extends BusinessLayer {
try {
$this->update($feed->getId(), $feed->getUserId());
} catch(BusinessLayerException $ex){
- $this->logger->log('Could not update feed ' . $ex->getMessage(),
- 'debug');
+ $this->logger->debug('Could not update feed ' . $ex->getMessage(),
+ $this->loggerParams);
}
}
}
@@ -200,9 +206,10 @@ class FeedBusinessLayer extends BusinessLayer {
} catch(FetcherException $ex){
// failed updating is not really a problem, so only log it
- $this->logger->log('Can not update feed with url ' . $existingFeed->getUrl() .
- ': Not found or bad source', 'debug');
- $this->logger->log($ex->getMessage(), 'debug');
+
+ $this->logger->debug('Can not update feed with url ' . $existingFeed->getUrl() .
+ ': Not found or bad source', $this->loggerParams);
+ $this->logger->debug($ex->getMessage(), $this->loggerParams);
}
return $this->feedMapper->find($feedId, $userId);
diff --git a/businesslayer/folderbusinesslayer.php b/businesslayer/folderbusinesslayer.php
index 924e23c25..f58e937b2 100644
--- a/businesslayer/folderbusinesslayer.php
+++ b/businesslayer/folderbusinesslayer.php
@@ -13,6 +13,8 @@
namespace OCA\News\BusinessLayer;
+use \OCP\IL10N;
+
use \OCA\News\Db\Folder;
use \OCA\News\Db\FolderMapper;
use \OCA\News\Utility\Config;
@@ -26,7 +28,7 @@ class FolderBusinessLayer extends BusinessLayer {
private $folderMapper;
public function __construct(FolderMapper $folderMapper,
- $l10n,
+ IL10N $l10n,
$timeFactory,
Config $config){
parent::__construct($folderMapper);
diff --git a/businesslayer/itembusinesslayer.php b/businesslayer/itembusinesslayer.php
index 85fa4d10f..23f6bcd2d 100644
--- a/businesslayer/itembusinesslayer.php
+++ b/businesslayer/itembusinesslayer.php
@@ -13,11 +13,12 @@
namespace OCA\News\BusinessLayer;
+use \OCP\AppFramework\Db\DoesNotExistException;
+
use \OCA\News\Db\Item;
use \OCA\News\Db\ItemMapper;
use \OCA\News\Db\StatusFlag;
use \OCA\News\Db\FeedType;
-use \OCA\News\Db\DoesNotExistException;
use \OCA\News\Utility\Config;
@@ -28,8 +29,10 @@ class ItemBusinessLayer extends BusinessLayer {
private $timeFactory;
private $itemMapper;
- public function __construct(ItemMapper $itemMapper, StatusFlag $statusFlag,
- $timeFactory, Config $config){
+ public function __construct(ItemMapper $itemMapper,
+ StatusFlag $statusFlag,
+ $timeFactory,
+ Config $config){
parent::__construct($itemMapper);
$this->statusFlag = $statusFlag;
$this->autoPurgeCount = $config->getAutoPurgeCount();