You are here

function filebrowser_filebrowser_metadata_get in Filebrowser 6.2

Same name and namespace in other branches
  1. 8 filebrowser.module \filebrowser_filebrowser_metadata_get()
  2. 7.4 filebrowser.module \filebrowser_filebrowser_metadata_get()
  3. 7.2 filebrowser.module \filebrowser_filebrowser_metadata_get()
  4. 7.3 filebrowser.module \filebrowser_filebrowser_metadata_get()

File

./filebrowser.module, line 604

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;
}