Revision 82183ebc
Von Jan Büren vor 10 Monaten hinzugefügt
SL/File/Backend/Filesystem.pm | ||
---|---|---|
4 | 4 |
|
5 | 5 |
use parent qw(SL::File::Backend); |
6 | 6 |
use SL::DB::File; |
7 |
|
|
7 | 8 |
use File::Copy; |
8 | 9 |
use File::Slurp; |
9 | 10 |
use File::stat; |
10 | 11 |
use File::Path qw(make_path); |
12 |
use UUID::Tiny ':std'; |
|
11 | 13 |
|
12 | 14 |
# |
13 | 15 |
# public methods |
... | ... | |
90 | 92 |
print OUT $params{file_contents}; |
91 | 93 |
close(OUT); |
92 | 94 |
} |
95 |
my $doc_path = $::lx_office_conf{paths}->{document_path}; |
|
96 |
my $rel_file = $tofile; |
|
97 |
$rel_file =~ s/$doc_path//; |
|
98 |
|
|
99 |
my $fv = SL::DB::FileVersion->new( |
|
100 |
file_id => $dbfile->id, |
|
101 |
version => $dbfile->backend_data, |
|
102 |
file_location => $rel_file, |
|
103 |
doc_path => $doc_path, |
|
104 |
backend => 'Filesystem', |
|
105 |
guid => create_uuid_as_string(UUID_V4), |
|
106 |
)->save; |
|
93 | 107 |
if ($params{mtime}) { |
94 | 108 |
utime($params{mtime}, $params{mtime}, $tofile); |
95 | 109 |
} |
Auch abrufbar als: Unified diff
DMS Backend Filesystem Metadaten für Version beim Speichern mitgeben