aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_versions/lib/versions.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_versions/lib/versions.php')
-rw-r--r--apps/files_versions/lib/versions.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/apps/files_versions/lib/versions.php b/apps/files_versions/lib/versions.php
index 003d548d2b2..b54bc4a4422 100644
--- a/apps/files_versions/lib/versions.php
+++ b/apps/files_versions/lib/versions.php
@@ -13,7 +13,7 @@
* A class to handle the versioning of files.
*/
-namespace OCA_Versions;
+namespace OCA\Files_Versions;
class Storage {
@@ -195,6 +195,7 @@ class Storage {
$files_view = new \OC_FilesystemView('/'.$uid.'/files');
$local_file = $files_view->getLocalFile($filename);
+ $local_file_md5 = \md5_file( $local_file );
foreach( $matches as $ma ) {
$parts = explode( '.v', $ma );
@@ -206,7 +207,7 @@ class Storage {
$versions[$key]['size'] = $versions_fileview->filesize($filename.'.v'.$version);
// if file with modified date exists, flag it in array as currently enabled version
- ( \md5_file( $ma ) == \md5_file( $local_file ) ? $versions[$key]['fileMatch'] = 1 : $versions[$key]['fileMatch'] = 0 );
+ ( \md5_file( $ma ) == $local_file_md5 ? $versions[$key]['fileMatch'] = 1 : $versions[$key]['fileMatch'] = 0 );
}
@@ -333,7 +334,8 @@ class Storage {
}
// calculate available space for version history
- $rootInfo = \OC_FileCache::get('', '/'. $uid . '/files');
+ $files_view = new \OC_FilesystemView('/'.$uid.'/files');
+ $rootInfo = $files_view->getFileInfo('/');
$free = $quota-$rootInfo['size']; // remaining free space for user
if ( $free > 0 ) {
$availableSpace = ($free * self::DEFAULTMAXSIZE / 100) - $versionsSize; // how much space can be used for versions