[Pkg-owncloud-commits] [owncloud] 21/66: Removed unused versions md5 code
David Prévot
taffit at moszumanska.debian.org
Fri Apr 18 22:49:44 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to annotated tag v5.0.15
in repository owncloud.
commit f7e91518a63805c85d9b617eb8e66d1c762e0161
Author: Vincent Petry <pvince81 at owncloud.com>
Date: Mon Feb 17 12:03:16 2014 +0100
Removed unused versions md5 code
It looks like md5 was used previously to identify the most recent file
in the versions list, which seem to be old code, as now the versions
list doesn't contain the current file any more.
This fix removes the md5 code which caused performance issues with big
files.
---
apps/files_versions/lib/versions.php | 19 -------------------
apps/files_versions/templates/history.php | 3 ---
2 files changed, 22 deletions(-)
diff --git a/apps/files_versions/lib/versions.php b/apps/files_versions/lib/versions.php
index 9efbe88..a03ccb8 100644
--- a/apps/files_versions/lib/versions.php
+++ b/apps/files_versions/lib/versions.php
@@ -256,35 +256,16 @@ class Storage {
sort( $matches );
$files_view = new \OC\Files\View('/'.$uid.'/files');
- $local_file = $files_view->getLocalFile($filename);
- $local_file_md5 = \md5_file( $local_file );
foreach( $matches as $ma ) {
$parts = explode( '.v', $ma );
$version = ( end( $parts ) );
$key = $version.'#'.$filename;
- $versions[$key]['cur'] = 0;
$versions[$key]['version'] = $version;
$versions[$key]['path'] = $filename;
$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 ) == $local_file_md5 ? $versions[$key]['fileMatch'] = 1 : $versions[$key]['fileMatch'] = 0 );
-
- }
-
- $versions = array_reverse( $versions );
-
- foreach( $versions as $key => $value ) {
- // flag the first matched file in array (which will have latest modification date) as current version
- if ( $value['fileMatch'] ) {
- $value['cur'] = 1;
- break;
- }
}
- $versions = array_reverse( $versions );
-
// only show the newest commits
if( $count != 0 and ( count( $versions )>$count ) ) {
$versions = array_slice( $versions, count( $versions ) - $count );
diff --git a/apps/files_versions/templates/history.php b/apps/files_versions/templates/history.php
index 3a6d5f0..2e28beb 100644
--- a/apps/files_versions/templates/history.php
+++ b/apps/files_versions/templates/history.php
@@ -24,9 +24,6 @@ if( isset( $_['message'] ) ) {
p(OCP\Util::formatDate( doubleval($v['version'])));
print_unescaped(' <a href="'.OCP\Util::linkTo('files_versions', 'history.php',
array('path' => $_['path'], 'revert' => $v['version'])) .'" class="button">Revert</a><br /><br />');
- if ( $v['cur'] ) {
- print_unescaped(' (<b>Current</b>)');
- }
print_unescaped('<br /><br />');
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list