summaryrefslogtreecommitdiffstats
path: root/apps/files_external/controller
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
parentd0f56876877d5681a6faf5e8882c4de48a9bd4dc (diff)
downloadnextcloud-server-6b18134ceb0fd46d5b5796c1bd396a93865722c2.tar.gz
nextcloud-server-6b18134ceb0fd46d5b5796c1bd396a93865722c2.zip
inject logger
Diffstat (limited to 'apps/files_external/controller')
-rw-r--r--apps/files_external/controller/globalstoragescontroller.php8
-rw-r--r--apps/files_external/controller/storagescontroller.php15
-rw-r--r--apps/files_external/controller/userglobalstoragescontroller.php7
-rw-r--r--apps/files_external/controller/userstoragescontroller.php8
4 files changed, 29 insertions, 9 deletions
diff --git a/apps/files_external/controller/globalstoragescontroller.php b/apps/files_external/controller/globalstoragescontroller.php
index 64bbf0feb3f..069e41a96b8 100644
--- a/apps/files_external/controller/globalstoragescontroller.php
+++ b/apps/files_external/controller/globalstoragescontroller.php
@@ -24,6 +24,7 @@ namespace OCA\Files_External\Controller;
use \OCP\IConfig;
+use OCP\ILogger;
use \OCP\IUserSession;
use \OCP\IRequest;
use \OCP\IL10N;
@@ -46,18 +47,21 @@ class GlobalStoragesController extends StoragesController {
* @param IRequest $request request object
* @param IL10N $l10n l10n service
* @param GlobalStoragesService $globalStoragesService storage service
+ * @param ILogger $logger
*/
public function __construct(
$AppName,
IRequest $request,
IL10N $l10n,
- GlobalStoragesService $globalStoragesService
+ GlobalStoragesService $globalStoragesService,
+ ILogger $logger
) {
parent::__construct(
$AppName,
$request,
$l10n,
- $globalStoragesService
+ $globalStoragesService,
+ $logger
);
}
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) {
diff --git a/apps/files_external/controller/userglobalstoragescontroller.php b/apps/files_external/controller/userglobalstoragescontroller.php
index 6b39b3dc92d..c6b51d94047 100644
--- a/apps/files_external/controller/userglobalstoragescontroller.php
+++ b/apps/files_external/controller/userglobalstoragescontroller.php
@@ -24,6 +24,7 @@ namespace OCA\Files_External\Controller;
use OCA\Files_External\Lib\Auth\AuthMechanism;
use OCA\Files_External\Lib\Auth\IUserProvided;
use OCA\Files_External\Lib\InsufficientDataForMeaningfulAnswerException;
+use OCP\ILogger;
use \OCP\IRequest;
use \OCP\IL10N;
use \OCP\AppFramework\Http\DataResponse;
@@ -57,13 +58,15 @@ class UserGlobalStoragesController extends StoragesController {
IRequest $request,
IL10N $l10n,
UserGlobalStoragesService $userGlobalStoragesService,
- IUserSession $userSession
+ IUserSession $userSession,
+ ILogger $logger
) {
parent::__construct(
$AppName,
$request,
$l10n,
- $userGlobalStoragesService
+ $userGlobalStoragesService,
+ $logger
);
$this->userSession = $userSession;
}
diff --git a/apps/files_external/controller/userstoragescontroller.php b/apps/files_external/controller/userstoragescontroller.php
index ccf8bc24e09..2a2a0bc63a6 100644
--- a/apps/files_external/controller/userstoragescontroller.php
+++ b/apps/files_external/controller/userstoragescontroller.php
@@ -25,6 +25,7 @@ namespace OCA\Files_External\Controller;
use OCA\Files_External\Lib\Auth\AuthMechanism;
use \OCP\IConfig;
+use OCP\ILogger;
use OCP\IUser;
use \OCP\IUserSession;
use \OCP\IRequest;
@@ -55,19 +56,22 @@ class UserStoragesController extends StoragesController {
* @param IL10N $l10n l10n service
* @param UserStoragesService $userStoragesService storage service
* @param IUserSession $userSession
+ * @param ILogger $logger
*/
public function __construct(
$AppName,
IRequest $request,
IL10N $l10n,
UserStoragesService $userStoragesService,
- IUserSession $userSession
+ IUserSession $userSession,
+ ILogger $logger
) {
parent::__construct(
$AppName,
$request,
$l10n,
- $userStoragesService
+ $userStoragesService,
+ $logger
);
$this->userSession = $userSession;
}