diff options
-rw-r--r-- | apps/federatedfilesharing/lib/OCM/CloudFederationProviderFiles.php | 3 | ||||
-rw-r--r-- | apps/files_sharing/lib/AppInfo/Application.php | 3 | ||||
-rw-r--r-- | apps/files_sharing/lib/External/Manager.php | 37 | ||||
-rw-r--r-- | apps/files_sharing/lib/Hooks.php | 3 | ||||
-rw-r--r-- | apps/files_sharing/tests/External/ManagerTest.php | 2 |
5 files changed, 32 insertions, 16 deletions
diff --git a/apps/federatedfilesharing/lib/OCM/CloudFederationProviderFiles.php b/apps/federatedfilesharing/lib/OCM/CloudFederationProviderFiles.php index cc6b260add6..94fbb7870d5 100644 --- a/apps/federatedfilesharing/lib/OCM/CloudFederationProviderFiles.php +++ b/apps/federatedfilesharing/lib/OCM/CloudFederationProviderFiles.php @@ -250,7 +250,8 @@ class CloudFederationProviderFiles implements ICloudFederationProvider { \OC::$server->getGroupManager(), \OC::$server->getUserManager(), $shareWith, - \OC::$server->query(IEventDispatcher::class) + \OC::$server->query(IEventDispatcher::class), + \OC::$server->getLogger() ); try { diff --git a/apps/files_sharing/lib/AppInfo/Application.php b/apps/files_sharing/lib/AppInfo/Application.php index 7f234e63660..3975a8a3bde 100644 --- a/apps/files_sharing/lib/AppInfo/Application.php +++ b/apps/files_sharing/lib/AppInfo/Application.php @@ -98,7 +98,8 @@ class Application extends App { $server->getGroupManager(), $server->getUserManager(), $uid, - $server->query(IEventDispatcher::class) + $server->query(IEventDispatcher::class), + $server->getLogger() ); }); diff --git a/apps/files_sharing/lib/External/Manager.php b/apps/files_sharing/lib/External/Manager.php index 247be47ac90..de566692d6b 100644 --- a/apps/files_sharing/lib/External/Manager.php +++ b/apps/files_sharing/lib/External/Manager.php @@ -14,6 +14,7 @@ * @author Robin Appelman <robin@icewind.nl> * @author Roeland Jago Douma <roeland@famdouma.nl> * @author Stefan Weil <sw@weilnetz.de> + * @author Vincent Petry <vincent@nextcloud.com> * * @license AGPL-3.0 * @@ -44,6 +45,7 @@ use OCP\Files\Storage\IStorageFactory; use OCP\Http\Client\IClientService; use OCP\IDBConnection; use OCP\IGroupManager; +use OCP\ILogger; use OCP\IUserManager; use OCP\Notification\IManager; use OCP\OCS\IDiscoveryService; @@ -89,18 +91,24 @@ class Manager { /** @var IEventDispatcher */ private $eventDispatcher; - public function __construct(IDBConnection $connection, - \OC\Files\Mount\Manager $mountManager, - IStorageFactory $storageLoader, - IClientService $clientService, - IManager $notificationManager, - IDiscoveryService $discoveryService, - ICloudFederationProviderManager $cloudFederationProviderManager, - ICloudFederationFactory $cloudFederationFactory, - IGroupManager $groupManager, - IUserManager $userManager, - ?string $uid, - IEventDispatcher $eventDispatcher) { + /** @var ILogger */ + private $logger; + + public function __construct( + IDBConnection $connection, + \OC\Files\Mount\Manager $mountManager, + IStorageFactory $storageLoader, + IClientService $clientService, + IManager $notificationManager, + IDiscoveryService $discoveryService, + ICloudFederationProviderManager $cloudFederationProviderManager, + ICloudFederationFactory $cloudFederationFactory, + IGroupManager $groupManager, + IUserManager $userManager, + ?string $uid, + IEventDispatcher $eventDispatcher, + ILogger $logger + ) { $this->connection = $connection; $this->mountManager = $mountManager; $this->storageLoader = $storageLoader; @@ -113,6 +121,7 @@ class Manager { $this->groupManager = $groupManager; $this->userManager = $userManager; $this->eventDispatcher = $eventDispatcher; + $this->logger = $logger; } /** @@ -535,6 +544,7 @@ class Manager { $this->removeReShares($id); } catch (\Doctrine\DBAL\Exception $ex) { + $this->logger->logException($ex); return false; } @@ -606,6 +616,7 @@ class Manager { $deleteResult->closeCursor(); } } catch (\Doctrine\DBAL\Exception $ex) { + $this->logger->logException($ex); return false; } @@ -677,7 +688,7 @@ class Manager { } return array_values($shares); } catch (\Doctrine\DBAL\Exception $e) { - // FIXME + $this->logger->logException($e); return []; } } diff --git a/apps/files_sharing/lib/Hooks.php b/apps/files_sharing/lib/Hooks.php index ff4ca59339a..26e799297ff 100644 --- a/apps/files_sharing/lib/Hooks.php +++ b/apps/files_sharing/lib/Hooks.php @@ -43,7 +43,8 @@ class Hooks { \OC::$server->getGroupManager(), \OC::$server->getUserManager(), $params['uid'], - \OC::$server->query(IEventDispatcher::class) + \OC::$server->query(IEventDispatcher::class), + \OC::$server->getLogger() ); $manager->removeUserShares($params['uid']); diff --git a/apps/files_sharing/tests/External/ManagerTest.php b/apps/files_sharing/tests/External/ManagerTest.php index 60380aa0619..1b8b3e1cf4b 100644 --- a/apps/files_sharing/tests/External/ManagerTest.php +++ b/apps/files_sharing/tests/External/ManagerTest.php @@ -44,6 +44,7 @@ use OCP\Http\Client\IResponse; use OCP\IGroup; use OCP\IGroupManager; use OCP\IURLGenerator; +use OCP\ILogger; use OCP\IUserManager; use OCP\Share\IShare; use Test\Traits\UserTrait; @@ -128,6 +129,7 @@ class ManagerTest extends TestCase { $this->userManager, $this->uid, $this->eventDispatcher, + $this->createMock(ILogger::class), ] )->setMethods(['tryOCMEndPoint'])->getMock(); |