Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
0e0d54dc
Commit
0e0d54dc
authored
12 years ago
by
Björn Schießle
Browse files
Options
Downloads
Patches
Plain Diff
get timestamp from file instead from time(); typo fixed
parent
2a423447
Loading
Loading
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
apps/files_versions/lib/versions.php
+11
-4
11 additions, 4 deletions
apps/files_versions/lib/versions.php
with
11 additions
and
4 deletions
apps/files_versions/lib/versions.php
+
11
−
4
View file @
0e0d54dc
...
...
@@ -92,7 +92,7 @@ class Storage {
}
// store a new version of a file
$users_view
->
copy
(
'files'
.
$filename
,
'files_versions'
.
$filename
.
'.v'
.
time
(
));
$users_view
->
copy
(
'files'
.
$filename
,
'files_versions'
.
$filename
.
'.v'
.
$users_view
->
filemtime
(
'files'
.
$filename
));
// expire old revisions if necessary
Storage
::
expire
(
$filename
);
...
...
@@ -109,13 +109,20 @@ class Storage {
list
(
$uid
,
$filename
)
=
self
::
getUidAndFilename
(
$filename
);
$users_view
=
new
\OC_FilesystemView
(
'/'
.
$uid
);
//first create a new version
if
(
!
$users_view
->
file_exists
(
'files_versions'
.
$filename
.
'.v'
.
$users_view
->
filemtime
(
'files'
.
$filename
)))
{
$version
=
'files_versions'
.
$filename
.
'.v'
.
$users_view
->
filemtime
(
'files'
.
$filename
);
$users_view
->
copy
(
'files'
.
$filename
,
'files_versions'
.
$filename
.
'.v'
.
$users_view
->
filemtime
(
'files'
.
$filename
));
}
// rollback
if
(
@
$users_view
->
copy
(
'files_versions'
.
$filename
.
'.v'
.
$revision
,
'files'
.
$filename
)
)
{
Storage
::
expire
(
$filename
);
return
true
;
}
else
{
if
(
isset
(
$version
)
)
{
$users_view
->
unlink
(
$version
);
return
false
;
}
...
...
@@ -274,7 +281,7 @@ class Storage {
}
else
{
// time to move on to the next interval
$interval
++
;
$step
=
Storage
::
$max_versions_per_interval
[
$interval
][
'step'
];
$nextVersion
=
$version
[
$i
][
'version'
]
-
$step
;
$nextVersion
=
$version
s
[
$i
][
'version'
]
-
$step
;
if
(
Storage
::
$max_versions_per_interval
[
$interval
][
'intervalEndsAfter'
]
==
-
1
)
{
$nextInterval
=
-
1
;
}
else
{
...
...
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