Skip to content
Snippets Groups Projects
Commit 929b8c3e authored by Robin Appelman's avatar Robin Appelman
Browse files

fix files_version hooks

parent 7207211f
No related branches found
No related tags found
No related merge requests found
...@@ -39,15 +39,15 @@ class Hooks { ...@@ -39,15 +39,15 @@ class Hooks {
* cleanup the versions directory if the actual file gets deleted * cleanup the versions directory if the actual file gets deleted
*/ */
public static function remove_hook($params) { public static function remove_hook($params) {
if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') { if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
$versions = new Storage( new \OC_FilesystemView('') ); $versions = new Storage( new \OC_FilesystemView('') );
$path = $params[\OC_Filesystem::signal_param_path]; $path = $params[\OC\Files\Filesystem::signal_param_path];
if($path<>'') $versions->delete( $path ); if($path<>'') $versions->delete( $path );
} }
} }
/** /**
...@@ -58,15 +58,15 @@ class Hooks { ...@@ -58,15 +58,15 @@ class Hooks {
* of the stored versions along the actual file * of the stored versions along the actual file
*/ */
public static function rename_hook($params) { public static function rename_hook($params) {
if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') { if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
$versions = new Storage( new \OC_FilesystemView('') ); $versions = new Storage( new \OC_FilesystemView('') );
$oldpath = $params['oldpath']; $oldpath = $params['oldpath'];
$newpath = $params['newpath']; $newpath = $params['newpath'];
if($oldpath<>'' && $newpath<>'') $versions->rename( $oldpath, $newpath ); if($oldpath<>'' && $newpath<>'') $versions->rename( $oldpath, $newpath );
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment