diff options
author | Bernhard Posselt <nukeawhale@gmail.com> | 2013-03-08 03:05:28 -0800 |
---|---|---|
committer | Bernhard Posselt <nukeawhale@gmail.com> | 2013-03-08 03:05:28 -0800 |
commit | 0525bbd73c9015499ba92d1ac654b980aaca35b2 (patch) | |
tree | 9038772de322c4e61b899d2dc188d9bb42953532 /lib | |
parent | 308c85090e8815339a24e4032466ffddfc0240e2 (diff) | |
parent | 8d26400cb5427763b0562da8799bea52f4eae21e (diff) | |
download | nextcloud-server-0525bbd73c9015499ba92d1ac654b980aaca35b2.tar.gz nextcloud-server-0525bbd73c9015499ba92d1ac654b980aaca35b2.zip |
Merge pull request #2189 from owncloud/versioning_sync_client
fix versioning for the sync client - distinguish between touch and write operation
Diffstat (limited to 'lib')
-rw-r--r-- | lib/files/view.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/files/view.php b/lib/files/view.php index 4ed3234552e..19f33ad64a2 100644 --- a/lib/files/view.php +++ b/lib/files/view.php @@ -245,7 +245,14 @@ class View { if (!is_null($mtime) and !is_numeric($mtime)) { $mtime = strtotime($mtime); } - return $this->basicOperation('touch', $path, array('write'), $mtime); + + $hooks = array('touch'); + + if (!$this->file_exists($path)) { + $hooks[] = 'write'; + } + + return $this->basicOperation('touch', $path, $hooks, $mtime); } public function file_get_contents($path) { @@ -596,6 +603,7 @@ class View { if ($path == null) { return false; } + $run = $this->runHooks($hooks, $path); list($storage, $internalPath) = Filesystem::resolvePath($absolutePath . $postFix); if ($run and $storage) { |