[Pkg-owncloud-commits] [owncloud] 98/145: Also clean up the filecache table when deleting a storage entry

David Prévot taffit at moszumanska.debian.org
Wed Feb 26 16:27:45 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit 118033cac6fe72fed5b54ee06d3e3809c4e4aefa
Author: Robin Appelman <icewind at owncloud.com>
Date:   Mon Feb 3 16:36:21 2014 +0100

    Also clean up the filecache table when deleting a storage entry
---
 lib/private/files/cache/storage.php | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lib/private/files/cache/storage.php b/lib/private/files/cache/storage.php
index 6d7a100..5b1b301 100644
--- a/lib/private/files/cache/storage.php
+++ b/lib/private/files/cache/storage.php
@@ -77,10 +77,16 @@ class Storage {
 	 * @param string $storageId
 	 */
 	public static function remove($storageId) {
+		$storageCache = new Storage($storageId);
+		$numericId = $storageCache->getNumericId();
+
 		if (strlen($storageId) > 64) {
 			$storageId = md5($storageId);
 		}
 		$sql = 'DELETE FROM `*PREFIX*storages` WHERE `id` = ?';
 		\OC_DB::executeAudited($sql, array($storageId));
+
+		$sql = 'DELETE FROM `*PREFIX*filecache` WHERE `storage` = ?';
+		\OC_DB::executeAudited($sql, array($numericId));
 	}
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list