summaryrefslogtreecommitdiffstats
path: root/lib/files/view.php
diff options
context:
space:
mode:
authorBjörn Schießle <schiessle@owncloud.com>2013-03-07 15:51:44 +0100
committerBjörn Schießle <schiessle@owncloud.com>2013-03-07 15:51:44 +0100
commit48bb53030c657e1133da47765c7c778a069af665 (patch)
tree5e38ce80da83978e8e7c4cc9f4a4bb916f2fae39 /lib/files/view.php
parent70f0e0a8da73f8eac3ec63e558377068a0e0a3b0 (diff)
downloadnextcloud-server-48bb53030c657e1133da47765c7c778a069af665.tar.gz
nextcloud-server-48bb53030c657e1133da47765c7c778a069af665.zip
distinguish between touch and write
Diffstat (limited to 'lib/files/view.php')
-rw-r--r--lib/files/view.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/files/view.php b/lib/files/view.php
index 3e2cb080e1d..59339ff2071 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;
}
+ foreach ($hooks as $h) if ($h == "write") error_log("write triggered by $operation for $path");
$run = $this->runHooks($hooks, $path);
list($storage, $internalPath) = Filesystem::resolvePath($absolutePath . $postFix);
if ($run and $storage) {