summaryrefslogtreecommitdiffstats
path: root/apps/files_external/controller/storagescontroller.php
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2016-01-28 13:07:19 +0100
committerRobin Appelman <icewind@owncloud.com>2016-01-29 14:51:30 +0100
commit6b18134ceb0fd46d5b5796c1bd396a93865722c2 (patch)
treee4294f1124b485ac97432b16148a08eb233720ee /apps/files_external/controller/storagescontroller.php
parentd0f56876877d5681a6faf5e8882c4de48a9bd4dc (diff)
downloadnextcloud-server-6b18134ceb0fd46d5b5796c1bd396a93865722c2.tar.gz
nextcloud-server-6b18134ceb0fd46d5b5796c1bd396a93865722c2.zip
inject logger
Diffstat (limited to 'apps/files_external/controller/storagescontroller.php')
-rw-r--r--apps/files_external/controller/storagescontroller.php15
1 files changed, 12 insertions, 3 deletions
diff --git a/apps/files_external/controller/storagescontroller.php b/apps/files_external/controller/storagescontroller.php
index b09774ef515..d71c4ff5ef7 100644
--- a/apps/files_external/controller/storagescontroller.php
+++ b/apps/files_external/controller/storagescontroller.php
@@ -25,6 +25,7 @@ namespace OCA\Files_External\Controller;
use \OCP\IConfig;
+use OCP\ILogger;
use OCP\IUser;
use \OCP\IUserSession;
use \OCP\IRequest;
@@ -61,22 +62,30 @@ abstract class StoragesController extends Controller {
protected $service;
/**
+ * @var ILogger
+ */
+ protected $logger;
+
+ /**
* Creates a new storages controller.
*
* @param string $AppName application name
* @param IRequest $request request object
* @param IL10N $l10n l10n service
* @param StoragesService $storagesService storage service
+ * @param ILogger $logger
*/
public function __construct(
$AppName,
IRequest $request,
IL10N $l10n,
- StoragesService $storagesService
+ StoragesService $storagesService,
+ ILogger $logger
) {
parent::__construct($AppName, $request);
$this->l10n = $l10n;
$this->service = $storagesService;
+ $this->logger = $logger;
}
/**
@@ -115,7 +124,7 @@ abstract class StoragesController extends Controller {
$priority
);
} catch (\InvalidArgumentException $e) {
- \OC::$server->getLogger()->logException($e);
+ $this->logger->logException($e);
return new DataResponse(
[
'message' => (string)$this->l10n->t('Invalid backend or authentication mechanism class')
@@ -129,7 +138,7 @@ abstract class StoragesController extends Controller {
* Validate storage config
*
* @param StorageConfig $storage storage config
- *
+ *1
* @return DataResponse|null returns response in case of validation error
*/
protected function validate(StorageConfig $storage) {