]> source.dussan.org Git - nextcloud-server.git/commitdiff
Cache: provide path hints to getCache/etc where available
authorRobin Appelman <icewind@owncloud.com>
Tue, 1 Jan 2013 19:19:53 +0000 (20:19 +0100)
committerRobin Appelman <icewind@owncloud.com>
Tue, 1 Jan 2013 19:20:20 +0000 (20:20 +0100)
lib/files/cache/updater.php
lib/files/view.php

index c8c96a97eea9e352e57e889981f3360597800bac..c14adba3e5578869c9565b67b760f037251bd78a 100644 (file)
@@ -31,8 +31,8 @@ class Updater {
                 */
                list($storage, $internalPath) = self::resolvePath($path);
                if ($storage) {
-                       $cache = $storage->getCache();
-                       $scanner = $storage->getScanner();
+                       $cache = $storage->getCache($internalPath);
+                       $scanner = $storage->getScanner($internalPath);
                        $scanner->scan($internalPath, Scanner::SCAN_SHALLOW);
                        $cache->correctFolderSize($internalPath);
                }
@@ -45,7 +45,7 @@ class Updater {
                 */
                list($storage, $internalPath) = self::resolvePath($path);
                if ($storage) {
-                       $cache = $storage->getCache();
+                       $cache = $storage->getCache($internalPath);
                        $cache->remove($internalPath);
                        $cache->correctFolderSize($internalPath);
                }
index d3f93d39f5a8e82e0ae2250191f9e4a6a206e6ac..8558b03fe1ea2d02a34ee84ca145bc0f5f993694 100644 (file)
@@ -679,13 +679,13 @@ class View {
                 */
                list($storage, $internalPath) = Filesystem::resolvePath($path);
                if ($storage) {
-                       $cache = $storage->getCache();
+                       $cache = $storage->getCache($internalPath);
 
                        if (!$cache->inCache($internalPath)) {
-                               $scanner = $storage->getScanner();
+                               $scanner = $storage->getScanner($internalPath);
                                $scanner->scan($internalPath, Cache\Scanner::SCAN_SHALLOW);
                        } else {
-                               $watcher = $storage->getWatcher();
+                               $watcher = $storage->getWatcher($internalPath);
                                $watcher->checkUpdate($internalPath);
                        }
 
@@ -698,14 +698,14 @@ class View {
                                        foreach ($mountPoints as $mountPoint) {
                                                $subStorage = Filesystem::getStorage($mountPoint);
                                                if ($subStorage) {
-                                                       $subCache = $subStorage->getCache();
+                                                       $subCache = $subStorage->getCache('');
                                                        $rootEntry = $subCache->get('');
                                                        $data['size'] += $rootEntry['size'];
                                                }
                                        }
                                }
 
-                               $permissionsCache = $storage->getPermissionsCache();
+                               $permissionsCache = $storage->getPermissionsCache($internalPath);
                                $data['permissions'] = $permissionsCache->get($data['fileid'], \OC_User::getUser());
                        }
                }
@@ -727,13 +727,13 @@ class View {
                 */
                list($storage, $internalPath) = Filesystem::resolvePath($path);
                if ($storage) {
-                       $cache = $storage->getCache();
+                       $cache = $storage->getCache($internalPath);
 
                        if ($cache->getStatus($internalPath) < Cache\Cache::COMPLETE) {
-                               $scanner = $storage->getScanner();
+                               $scanner = $storage->getScanner($internalPath);
                                $scanner->scan($internalPath, Cache\Scanner::SCAN_SHALLOW);
                        } else {
-                               $watcher = $storage->getWatcher();
+                               $watcher = $storage->getWatcher($internalPath);
                                $watcher->checkUpdate($internalPath);
                        }
 
@@ -745,7 +745,7 @@ class View {
                        foreach ($mountPoints as $mountPoint) {
                                $subStorage = Filesystem::getStorage($mountPoint);
                                if ($subStorage) {
-                                       $subCache = $subStorage->getCache();
+                                       $subCache = $subStorage->getCache('');
                                        $rootEntry = $subCache->get('');
 
                                        $relativePath = trim(substr($mountPoint, $dirLength), '/');
@@ -769,7 +769,7 @@ class View {
                                $files[$i]['type'] = $file['mimetype'] === 'httpd/unix-directory' ? 'dir' : 'file';
                                $ids[] = $file['fileid'];
                        }
-                       $permissionsCache = $storage->getPermissionsCache();
+                       $permissionsCache = $storage->getPermissionsCache($internalPath);
 
                        $permissions = $permissionsCache->getMultiple($ids, \OC_User::getUser());
                        foreach ($files as $i => $file) {
@@ -812,10 +812,10 @@ class View {
                 */
                list($storage, $internalPath) = Filesystem::resolvePath($path);
                if ($storage) {
-                       $cache = $storage->getCache();
+                       $cache = $storage->getCache($path);
 
                        if (!$cache->inCache($internalPath)) {
-                               $scanner = $storage->getScanner();
+                               $scanner = $storage->getScanner($internalPath);
                                $scanner->scan($internalPath, Cache\Scanner::SCAN_SHALLOW);
                        }
 
@@ -857,7 +857,7 @@ class View {
                $mountPoint = Filesystem::getMountPoint($this->fakeRoot);
                $storage = Filesystem::getStorage($mountPoint);
                if ($storage) {
-                       $cache = $storage->getCache();
+                       $cache = $storage->getCache('');
 
                        $results = $cache->$method($query);
                        foreach ($results as $result) {
@@ -871,7 +871,7 @@ class View {
                        foreach ($mountPoints as $mountPoint) {
                                $storage = Filesystem::getStorage($mountPoint);
                                if ($storage) {
-                                       $cache = $storage->getCache();
+                                       $cache = $storage->getCache('');
 
                                        $relativeMountPoint = substr($mountPoint, $rootLength);
                                        $results = $cache->$method($query);