|
|
|
@ -39,15 +39,15 @@ class Hooks { |
|
|
|
|
* cleanup the versions directory if the actual file gets deleted |
|
|
|
|
*/ |
|
|
|
|
public static function remove_hook($params) { |
|
|
|
|
if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') { |
|
|
|
|
|
|
|
|
|
$versions = new Storage( new \OC_FilesystemView('') ); |
|
|
|
|
|
|
|
|
|
$path = $params[\OC_Filesystem::signal_param_path]; |
|
|
|
|
|
|
|
|
|
if($path<>'') $versions->delete( $path ); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') { |
|
|
|
|
|
|
|
|
|
$versions = new Storage( new \OC_FilesystemView('') ); |
|
|
|
|
|
|
|
|
|
$path = $params[\OC\Files\Filesystem::signal_param_path]; |
|
|
|
|
|
|
|
|
|
if($path<>'') $versions->delete( $path ); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -58,15 +58,15 @@ class Hooks { |
|
|
|
|
* of the stored versions along the actual file |
|
|
|
|
*/ |
|
|
|
|
public static function rename_hook($params) { |
|
|
|
|
if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') { |
|
|
|
|
|
|
|
|
|
$versions = new Storage( new \OC_FilesystemView('') ); |
|
|
|
|
|
|
|
|
|
if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') { |
|
|
|
|
|
|
|
|
|
$versions = new Storage( new \OC_FilesystemView('') ); |
|
|
|
|
|
|
|
|
|
$oldpath = $params['oldpath']; |
|
|
|
|
$newpath = $params['newpath']; |
|
|
|
|
|
|
|
|
|
if($oldpath<>'' && $newpath<>'') $versions->rename( $oldpath, $newpath ); |
|
|
|
|
|
|
|
|
|
$newpath = $params['newpath']; |
|
|
|
|
|
|
|
|
|
if($oldpath<>'' && $newpath<>'') $versions->rename( $oldpath, $newpath ); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|