]> source.dussan.org Git - nextcloud-server.git/commitdiff
Only check for local shared storages 2745/head
authorRoeland Jago Douma <roeland@famdouma.nl>
Mon, 19 Dec 2016 18:53:35 +0000 (19:53 +0100)
committerRoeland Jago Douma <roeland@famdouma.nl>
Tue, 10 Jan 2017 15:14:21 +0000 (16:14 +0100)
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
lib/private/Files/Utils/Scanner.php
tests/lib/Files/Utils/ScannerTest.php

index 3794e316dfe00feb5962e6b2a86a01aec9a92807..98e2c3c8ca2a655a1fb5ddb5d19966e8b106975a 100644 (file)
@@ -31,6 +31,7 @@ use OC\Files\Filesystem;
 use OC\ForbiddenException;
 use OC\Hooks\PublicEmitter;
 use OC\Lock\DBLockingProvider;
+use OCA\Files_Sharing\SharedStorage;
 use OCP\Files\Storage\IStorage;
 use OCP\Files\StorageNotAvailableException;
 use OCP\ILogger;
@@ -128,7 +129,7 @@ class Scanner extends PublicEmitter {
                        }
 
                        // don't scan received local shares, these can be scanned when scanning the owner's storage
-                       if ($storage->instanceOfStorage('OCA\Files_Sharing\ISharedStorage')) {
+                       if ($storage->instanceOfStorage(SharedStorage::class)) {
                                continue;
                        }
                        $scanner = $storage->getScanner();
@@ -178,7 +179,7 @@ class Scanner extends PublicEmitter {
                        }
 
                        // don't scan received local shares, these can be scanned when scanning the owner's storage
-                       if ($storage->instanceOfStorage('OCA\Files_Sharing\ISharedStorage')) {
+                       if ($storage->instanceOfStorage(SharedStorage::class)) {
                                continue;
                        }
                        $relativePath = $mount->getInternalPath($dir);
index 6d6007551ce464586d0fd900a3643b511e09359b..1379bc2e906c2af509b7c072fc13899760688233 100644 (file)
@@ -11,6 +11,7 @@ namespace Test\Files\Utils;
 use OC\Files\Filesystem;
 use OC\Files\Mount\MountPoint;
 use OC\Files\Storage\Temporary;
+use OCA\Files_Sharing\SharedStorage;
 use OCP\Files\Config\IMountProvider;
 use OCP\Files\Storage\IStorageFactory;
 use OCP\IUser;
@@ -190,14 +191,14 @@ class ScannerTest extends \Test\TestCase {
        }
 
        public function testSkipLocalShares() {
-               $sharedStorage = $this->createMock('OCA\Files_Sharing\SharedStorage');
+               $sharedStorage = $this->createMock(SharedStorage::class);
                $sharedMount = new MountPoint($sharedStorage, '/share');
                Filesystem::getMountManager()->addMount($sharedMount);
 
                $sharedStorage->expects($this->any())
                        ->method('instanceOfStorage')
                        ->will($this->returnValueMap([
-                               ['OCA\Files_Sharing\ISharedStorage', true],
+                               [SharedStorage::class, true],
                        ]));
                $sharedStorage->expects($this->never())
                        ->method('getScanner');