diff options
author | kondou <kondou@ts.unde.re> | 2014-03-21 20:23:31 +0100 |
---|---|---|
committer | kondou <kondou@ts.unde.re> | 2014-03-21 20:23:31 +0100 |
commit | dda7129a243c7ebdbcdf9c2b5dbf167542402bc2 (patch) | |
tree | d03dff6783ebabb6273a19ed59a6b9b3731e923e /apps/files_versions/lib/versions.php | |
parent | 556c6eca2397eaa03c4503822d647c8b6cb5e70e (diff) | |
parent | 4be0b3f6cce540282c6745d6bf3d2a0fa4ac65b4 (diff) | |
download | nextcloud-server-dda7129a243c7ebdbcdf9c2b5dbf167542402bc2.tar.gz nextcloud-server-dda7129a243c7ebdbcdf9c2b5dbf167542402bc2.zip |
Merge branch 'master' of https://github.com/owncloud/core into last_cron_log
Diffstat (limited to 'apps/files_versions/lib/versions.php')
-rw-r--r-- | apps/files_versions/lib/versions.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/files_versions/lib/versions.php b/apps/files_versions/lib/versions.php index 2bd9c15bae4..290264a90cc 100644 --- a/apps/files_versions/lib/versions.php +++ b/apps/files_versions/lib/versions.php @@ -178,6 +178,7 @@ class Storage { $versionsSize = self::calculateSize($uid); } foreach ($versions as $v) { + \OC_Hook::emit('\OCP\Versions', 'preDelete', array('path' => $abs_path . $v['version'])); unlink($abs_path . $v['version']); \OC_Hook::emit('\OCP\Versions', 'delete', array('path' => $abs_path . $v['version'])); $versionsSize -= $v['size']; @@ -542,8 +543,9 @@ class Storage { } foreach($toDelete as $key => $path) { - \OC_Hook::emit('\OCP\Versions', 'delete', array('path' => $path)); + \OC_Hook::emit('\OCP\Versions', 'preDelete', array('path' => $path)); $versionsFileview->unlink($path); + \OC_Hook::emit('\OCP\Versions', 'delete', array('path' => $path)); unset($allVersions[$key]); // update array with the versions we keep \OCP\Util::writeLog('files_versions', "Expire: " . $path, \OCP\Util::DEBUG); } @@ -555,6 +557,7 @@ class Storage { $i = 0; while ($availableSpace < 0 && $i < $numOfVersions) { $version = current($allVersions); + \OC_Hook::emit('\OCP\Versions', 'preDelete', array('path' => $version['path'].'.v'.$version['version'])); $versionsFileview->unlink($version['path'].'.v'.$version['version']); \OC_Hook::emit('\OCP\Versions', 'delete', array('path' => $version['path'].'.v'.$version['version'])); \OCP\Util::writeLog('files_versions', 'running out of space! Delete oldest version: ' . $version['path'].'.v'.$version['version'] , \OCP\Util::DEBUG); |