diff options
author | Joas Schilling <213943+nickvergessen@users.noreply.github.com> | 2022-04-21 16:24:04 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-21 16:24:04 +0200 |
commit | dd736fa1da93a2cb65611cefa209da703f263775 (patch) | |
tree | 64a01e98fa1cc42d7523cac2a13ad566cf287635 /apps/files_sharing | |
parent | f4135c72f505f13891e0b05e7e4f4d2d921462b0 (diff) | |
parent | e3ade5507d0af76641d3a95150c6ec6a8ad58f73 (diff) | |
download | nextcloud-server-dd736fa1da93a2cb65611cefa209da703f263775.tar.gz nextcloud-server-dd736fa1da93a2cb65611cefa209da703f263775.zip |
Merge pull request #32042 from nextcloud/shared-storage-instanceof-common
improve optimization for SharedStorage::instanceOfStorage(Common)
Diffstat (limited to 'apps/files_sharing')
-rw-r--r-- | apps/files_sharing/lib/SharedStorage.php | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/apps/files_sharing/lib/SharedStorage.php b/apps/files_sharing/lib/SharedStorage.php index 6a342f0bdbf..8d123e7b873 100644 --- a/apps/files_sharing/lib/SharedStorage.php +++ b/apps/files_sharing/lib/SharedStorage.php @@ -35,7 +35,11 @@ namespace OCA\Files_Sharing; use OC\Files\Cache\FailedCache; use OC\Files\Cache\NullWatcher; use OC\Files\Cache\Watcher; +use OC\Files\ObjectStore\HomeObjectStoreStorage; +use OC\Files\Storage\Common; +use OC\Files\Storage\Home; use OCP\Files\Folder; +use OCP\Files\IHomeStorage; use OCP\Files\Node; use OC\Files\Storage\FailedStorage; use OC\Files\Storage\Wrapper\PermissionsMask; @@ -182,10 +186,17 @@ class SharedStorage extends \OC\Files\Storage\Wrapper\Jail implements ISharedSto * @inheritdoc */ public function instanceOfStorage($class): bool { - if ($class === '\OC\Files\Storage\Common') { + if ($class === '\OC\Files\Storage\Common' || $class == Common::class) { return true; } - if (in_array($class, ['\OC\Files\Storage\Home', '\OC\Files\ObjectStore\HomeObjectStoreStorage', '\OCP\Files\IHomeStorage'])) { + if (in_array($class, [ + '\OC\Files\Storage\Home', + '\OC\Files\ObjectStore\HomeObjectStoreStorage', + '\OCP\Files\IHomeStorage', + Home::class, + HomeObjectStoreStorage::class, + IHomeStorage::class + ])) { return false; } return parent::instanceOfStorage($class); |