diff options
author | Robin Appelman <icewind@owncloud.com> | 2015-12-02 15:14:40 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2016-01-14 12:54:42 +0100 |
commit | a3d50ef49a4c7183086398133793d4788bbf7901 (patch) | |
tree | 3b4ac6b3db3a2b0b56de5088017e4810324db009 /lib/private | |
parent | c27894791ebc2174cad82dc4039e8bb343114c50 (diff) | |
download | nextcloud-server-a3d50ef49a4c7183086398133793d4788bbf7901.tar.gz nextcloud-server-a3d50ef49a4c7183086398133793d4788bbf7901.zip |
add watcher interface
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/files/cache/watcher.php | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/private/files/cache/watcher.php b/lib/private/files/cache/watcher.php index bb80dcbd80c..a00e875a2d4 100644 --- a/lib/private/files/cache/watcher.php +++ b/lib/private/files/cache/watcher.php @@ -22,14 +22,13 @@ */ namespace OC\Files\Cache; +use OCP\Files\Cache\ICacheEntry; +use OCP\Files\Cache\IWatcher; /** * check the storage backends for updates and change the cache accordingly */ -class Watcher { - const CHECK_NEVER = 0; // never check the underlying filesystem for updates - const CHECK_ONCE = 1; // check the underlying filesystem for updates once every request for each file - const CHECK_ALWAYS = 2; // always check the underlying filesystem for updates +class Watcher implements IWatcher { protected $watchPolicy = self::CHECK_ONCE; @@ -77,7 +76,7 @@ class Watcher { * check $path for updates and update if needed * * @param string $path - * @param array $cachedEntry + * @param ICacheEntry|null $cachedEntry * @return boolean true if path was updated */ public function checkUpdate($path, $cachedEntry = null) { @@ -96,7 +95,7 @@ class Watcher { * Update the cache for changes to $path * * @param string $path - * @param array $cachedData + * @param ICacheEntry $cachedData */ public function update($path, $cachedData) { if ($this->storage->is_dir($path)) { @@ -114,7 +113,7 @@ class Watcher { * Check if the cache for $path needs to be updated * * @param string $path - * @param array $cachedData + * @param ICacheEntry $cachedData * @return bool */ public function needsUpdate($path, $cachedData) { |