function filebrowser_filebrowser_metadata_get in Filebrowser 7.4
Same name and namespace in other branches
- 8 filebrowser.module \filebrowser_filebrowser_metadata_get()
- 6.2 filebrowser.module \filebrowser_filebrowser_metadata_get()
- 7.2 filebrowser.module \filebrowser_filebrowser_metadata_get()
- 7.3 filebrowser.module \filebrowser_filebrowser_metadata_get()
File
- ./
filebrowser.module, line 1320
Code
function filebrowser_filebrowser_metadata_get($file) {
$full_path = $file['full-path'];
$is_file = is_file($full_path);
$result = array(
'created' => 0,
'modified' => 0,
'size' => 0,
'kind' => $is_file ? 0 : 1,
'mime-type' => !$is_file ? "folder" : file_get_mimetype($full_path),
'description' => _filebrowser_read_description($full_path),
);
if (($f_stats = stat($full_path)) !== FALSE) {
if (is_file($full_path)) {
$result['size'] = $f_stats['size'];
}
$result['created'] = $f_stats['ctime'];
$result['modified'] = $f_stats['mtime'];
}
return $result;
}