]> source.dussan.org Git - nextcloud-server.git/commitdiff
optimize cache jail creation 41325/head
authorRobin Appelman <robin@icewind.nl>
Thu, 19 Oct 2023 17:27:00 +0000 (19:27 +0200)
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>
Tue, 7 Nov 2023 13:59:40 +0000 (13:59 +0000)
Signed-off-by: Robin Appelman <robin@icewind.nl>
lib/private/Files/Cache/Wrapper/CacheJail.php
lib/private/Files/Storage/Wrapper/Jail.php

index c444647383329b204a4002af8738282d3665d645..6ad753f3b3923ebaba8235858b92fccc61f2b94d 100644 (file)
@@ -52,8 +52,6 @@ class CacheJail extends CacheWrapper {
        public function __construct($cache, $root) {
                parent::__construct($cache);
                $this->root = $root;
-               $this->connection = \OC::$server->getDatabaseConnection();
-               $this->mimetypeLoader = \OC::$server->getMimeTypeLoader();
 
                if ($cache instanceof CacheJail) {
                        $this->unjailedRoot = $cache->getSourcePath($root);
index e21a2cba244a8edda00a8e4dd895b0059b78674b..255c800d13f801e368adf133c7937291d1cf2014 100644 (file)
@@ -396,10 +396,7 @@ class Jail extends Wrapper {
         * @return \OC\Files\Cache\Cache
         */
        public function getCache($path = '', $storage = null) {
-               if (!$storage) {
-                       $storage = $this->getWrapperStorage();
-               }
-               $sourceCache = $this->getWrapperStorage()->getCache($this->getUnjailedPath($path), $storage);
+               $sourceCache = $this->getWrapperStorage()->getCache($this->getUnjailedPath($path));
                return new CacheJail($sourceCache, $this->rootPath);
        }