21 lines
No EOL
471 B
PHP
21 lines
No EOL
471 B
PHP
<?php
|
|
|
|
function getFileData($file) {
|
|
$data = [
|
|
'url' => $file->url(),
|
|
'uuid' => (string) $file->uuid(),
|
|
'name' => $file->filename(),
|
|
'type' => (string) $file->type(),
|
|
];
|
|
|
|
if ($file->description()->exists()) {
|
|
$data['description'] = $file->description()->value();
|
|
$data['tags'] = $file->tags()->split();
|
|
};
|
|
|
|
if($file->comments()->exists()) {
|
|
$data['comments'] = Data::decode($file->comments()->value(), 'yaml');
|
|
}
|
|
|
|
return $data;
|
|
} |