diff options
author | Björn Schießle <schiessle@owncloud.com> | 2013-01-10 18:04:30 +0100 |
---|---|---|
committer | Björn Schießle <schiessle@owncloud.com> | 2013-01-10 18:04:30 +0100 |
commit | dca0fda2ad84401f984410a7b9ae2526e47234bb (patch) | |
tree | 235caa3467aac509eaf4951264564a536c6b0875 /apps/files_versions/lib/hooks.php | |
parent | 417498d519e0a901ad65ad960529a593f0f2aa11 (diff) | |
download | nextcloud-server-dca0fda2ad84401f984410a7b9ae2526e47234bb.tar.gz nextcloud-server-dca0fda2ad84401f984410a7b9ae2526e47234bb.zip |
keep track of the size of the versions directory
Diffstat (limited to 'apps/files_versions/lib/hooks.php')
-rw-r--r-- | apps/files_versions/lib/hooks.php | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/apps/files_versions/lib/hooks.php b/apps/files_versions/lib/hooks.php index e897a81f7af..736d9cd8687 100644 --- a/apps/files_versions/lib/hooks.php +++ b/apps/files_versions/lib/hooks.php @@ -39,15 +39,15 @@ class Hooks { * cleanup the versions directory if the actual file gets deleted */ public static function remove_hook($params) { - $versions_fileview = \OCP\Files::getStorage('files_versions'); - $rel_path = $params['path']; - $abs_path = \OCP\Config::getSystemValue('datadirectory').$versions_fileview->getAbsolutePath('').$rel_path.'.v'; - if(Storage::isversioned($rel_path)) { - $versions = Storage::getVersions($rel_path); - foreach ($versions as $v) { - unlink($abs_path . $v['version']); - } - } + 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 );
+
+ }
} /** |