use \OCP\IConfig;
+use OCP\ILogger;
use \OCP\IUserSession;
use \OCP\IRequest;
use \OCP\IL10N;
* @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
);
}
use \OCP\IConfig;
+use OCP\ILogger;
use OCP\IUser;
use \OCP\IUserSession;
use \OCP\IRequest;
*/
protected $service;
+ /**
+ * @var ILogger
+ */
+ protected $logger;
+
/**
* Creates a new storages controller.
*
* @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;
}
/**
$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')
* Validate storage config
*
* @param StorageConfig $storage storage config
- *
+ *1
* @return DataResponse|null returns response in case of validation error
*/
protected function validate(StorageConfig $storage) {
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;
IRequest $request,
IL10N $l10n,
UserGlobalStoragesService $userGlobalStoragesService,
- IUserSession $userSession
+ IUserSession $userSession,
+ ILogger $logger
) {
parent::__construct(
$AppName,
$request,
$l10n,
- $userGlobalStoragesService
+ $userGlobalStoragesService,
+ $logger
);
$this->userSession = $userSession;
}
use OCA\Files_External\Lib\Auth\AuthMechanism;
use \OCP\IConfig;
+use OCP\ILogger;
use OCP\IUser;
use \OCP\IUserSession;
use \OCP\IRequest;
* @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;
}
'files_external',
$this->getMock('\OCP\IRequest'),
$this->getMock('\OCP\IL10N'),
- $this->service
+ $this->service,
+ $this->getMock('\OCP\ILogger')
);
}
}
$this->getMock('\OCP\IRequest'),
$this->getMock('\OCP\IL10N'),
$this->service,
- $this->getMock('\OCP\IUserSession')
+ $this->getMock('\OCP\IUserSession'),
+ $this->getMock('\OCP\ILogger')
);
}