From 2dcdc8147780707b11c03c92281a8076b0a873b6 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Wed, 2 Dec 2015 14:03:52 +0100 Subject: [PATCH] propagator interface --- lib/private/files/cache/propagator.php | 6 +++-- lib/public/files/cache/ipropagator.php | 34 ++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 lib/public/files/cache/ipropagator.php diff --git a/lib/private/files/cache/propagator.php b/lib/private/files/cache/propagator.php index 56abcdadee2..1e85a2ecc8b 100644 --- a/lib/private/files/cache/propagator.php +++ b/lib/private/files/cache/propagator.php @@ -21,10 +21,12 @@ namespace OC\Files\Cache; +use OCP\Files\Cache\IPropagator; + /** * Propagate etags and mtimes within the storage */ -class Propagator { +class Propagator implements IPropagator { /** * @var \OC\Files\Storage\Storage */ @@ -41,7 +43,7 @@ class Propagator { /** * @param string $internalPath * @param int $time - * @return array[] all propagated entries + * @return array[] all propagated cache entries */ public function propagateChange($internalPath, $time) { $cache = $this->storage->getCache($internalPath); diff --git a/lib/public/files/cache/ipropagator.php b/lib/public/files/cache/ipropagator.php new file mode 100644 index 00000000000..90bdf9af53d --- /dev/null +++ b/lib/public/files/cache/ipropagator.php @@ -0,0 +1,34 @@ +> + * + * @copyright Copyright (c) 2015, ownCloud, Inc. + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see + * + */ + +namespace OCP\Files\Cache; + +/** + * Propagate etags and mtimes within the storage + */ +interface IPropagator { + /** + * @param string $internalPath + * @param int $time + * @return array[] all propagated cache entries + */ + public function propagateChange($internalPath, $time); +}