Revision 95b5d54b
Von Bernd Bleßmann vor mehr als 2 Jahren hinzugefügt
SL/Webdav/File.pm | ||
---|---|---|
58 | 58 |
$params{new_version} = 1; |
59 | 59 |
} |
60 | 60 |
|
61 |
# Do not create a new version of the document if file size of last version is the same. |
|
62 |
if ($params{new_version}) { |
|
63 |
my $last_file_size = $last->size; |
|
64 |
my $new_file_size; |
|
65 |
if ($params{file}) { |
|
66 |
croak 'No valid file' unless -f $params{file}; |
|
67 |
$new_file_size = (stat($params{file}))[7]; |
|
68 |
} else { |
|
69 |
$new_file_size = length(${ $params{data} }); |
|
70 |
} |
|
71 |
$params{new_version} = 0 if $last_file_size == $new_file_size; |
|
72 |
} |
|
73 |
|
|
61 | 74 |
if ($params{new_version}) { |
62 | 75 |
my $new_version = $self->webdav->version_scheme->next_version($last); |
63 | 76 |
my $sep = $self->webdav->version_scheme->separator; |
... | ... | |
153 | 166 |
If param C<new_version> is set, force a new version, even if the versioning |
154 | 167 |
scheme would keep the old one. |
155 | 168 |
|
169 |
No new version is stored if the file or data size is euqal to the size of |
|
170 |
the last stored version. |
|
171 |
|
|
156 | 172 |
=back |
157 | 173 |
|
158 | 174 |
=head1 SEE ALSO |
Auch abrufbar als: Unified diff
SL:Webdav:File.pm->store: ungeänderte Dokumente nicht doppelt speichern.
Einfacher Größenvergleich mit letzter Version.