Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Nextcloud
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Nextcloud
Commits
a567f74d
Commit
a567f74d
authored
11 years ago
by
Björn Schießle
Browse files
Options
Downloads
Patches
Plain Diff
fix array order
parent
8d36ddcf
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
apps/files_versions/lib/versions.php
+3
-4
3 additions, 4 deletions
apps/files_versions/lib/versions.php
apps/files_versions/tests/versions.php
+1
-1
1 addition, 1 deletion
apps/files_versions/tests/versions.php
with
4 additions
and
5 deletions
apps/files_versions/lib/versions.php
+
3
−
4
View file @
a567f74d
...
...
@@ -264,7 +264,7 @@ class Storage {
* @param string $uid user id from the owner of the file
* @param string $filename file to find versions of, relative to the user files dir
* @param string $userFullPath
* @returns array
* @returns array
versions newest version first
*/
public
static
function
getVersions
(
$uid
,
$filename
,
$userFullPath
=
''
)
{
$versions
=
array
();
...
...
@@ -397,7 +397,8 @@ class Storage {
}
}
ksort
(
$versions
);
// newest version first
krsort
(
$versions
);
$result
=
array
();
...
...
@@ -428,8 +429,6 @@ class Storage {
$size
=
0
;
$toDelete
=
array
();
// versions we want to delete
$versions
=
array_reverse
(
$versions
);
// newest version first
$interval
=
1
;
$step
=
Storage
::
$max_versions_per_interval
[
$interval
][
'step'
];
if
(
Storage
::
$max_versions_per_interval
[
$interval
][
'intervalEndsAfter'
]
==
-
1
)
{
...
...
This diff is collapsed.
Click to expand it.
apps/files_versions/tests/versions.php
+
1
−
1
View file @
a567f74d
...
...
@@ -40,7 +40,7 @@ class Test_Files_Versioning extends \PHPUnit_Framework_TestCase {
$startTime
=
5000000
;
$testClass
=
new
VersionStorageToTest
();
list
(
$deleted
,
$size
)
=
$testClass
->
callProtectedGetExpireList
(
$startTime
,
array_reverse
(
$versions
)
)
;
list
(
$deleted
,
$size
)
=
$testClass
->
callProtectedGetExpireList
(
$startTime
,
$versions
);
// we should have deleted 16 files each of the size 1
$this
->
assertEquals
(
$sizeOfAllDeletedFiles
,
$size
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment