Revision 74d8dd6f
Von Martin Helmling martin.helmling@octosoft.eu vor etwa 7 Jahren hinzugefügt
SL/File.pm | ||
---|---|---|
220 | 220 |
title => $params{title}, |
221 | 221 |
description => $params{description}, |
222 | 222 |
); |
223 |
$file->itime($params{mtime}) if $params{mtime}; |
|
224 |
$params{itime} = $params{mtime} if $params{mtime}; |
|
223 | 225 |
} |
224 | 226 |
} else { |
225 | 227 |
$exists = 1; |
... | ... | |
236 | 238 |
# load itime for new file |
237 | 239 |
$file->save->load; |
238 | 240 |
} |
239 |
$main::lxdebug->message(LXDebug->DEBUG2(), "backend3=" .$file->backend); |
|
241 |
|
|
242 |
$file->mtime(DateTime->now_local) unless $params{mtime}; |
|
243 |
$file->mtime($params{mtime} ) if $params{mtime}; |
|
244 |
|
|
240 | 245 |
my $backend = $self->_get_backend($file->backend); |
241 | 246 |
$params{dbfile} = $file; |
242 | 247 |
$backend->save(%params); |
243 | 248 |
|
244 |
$file->mtime(DateTime->now_local); |
|
245 | 249 |
$file->save; |
246 | 250 |
#ShopImage |
247 | 251 |
if($file->object_type eq "shop_image"){ |
SL/File/Backend/Filesystem.pm | ||
---|---|---|
79 | 79 |
print OUT $params{file_contents}; |
80 | 80 |
close(OUT); |
81 | 81 |
} |
82 |
if ($params{mtime}) { |
|
83 |
utime($params{mtime}, $params{mtime}, $tofile); |
|
84 |
} |
|
82 | 85 |
return 1; |
83 | 86 |
} |
84 | 87 |
|
scripts/sync_files_from_backend.pl | ||
---|---|---|
82 | 82 |
setup(); |
83 | 83 |
|
84 | 84 |
SL::File->sync_from_backend( file_type => 'document'); |
85 |
SL::File->sync_from_backend( file_type => 'attachments');
|
|
86 |
SL::File->sync_from_backend( file_type => 'images');
|
|
85 |
SL::File->sync_from_backend( file_type => 'attachment'); |
|
86 |
SL::File->sync_from_backend( file_type => 'image'); |
|
87 | 87 |
|
88 | 88 |
1; |
Auch abrufbar als: Unified diff
Dateimanagment: itime/mtime in DB kann gesetzt werden, mtime kann in Filesystem-Backend gesetzt werden
Wird benötigt falls man bestehende Dateien übernehmen will