if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
$path = $params[\OC\Files\Filesystem::signal_param_path];
+ $pos = strrpos($path, '.part');
+ if ($pos) {
+ error_log("old path: $path");
+ $path = substr($path, 0, $pos);
+ error_log("new path: $path");
+ }
if($path<>'') {
Storage::store($path);
}
// store a new version of a file
$users_view->copy('files'.$filename, 'files_versions'.$filename.'.v'.$users_view->filemtime('files'.$filename));
+ error_log("version created!");
$versionsSize = self::getVersionsSize($uid);
if ( $versionsSize === false || $versionsSize < 0 ) {
$versionsSize = self::calculateSize($uid);
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) {
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) {