Ejemplo n.º 1
0
 /**
  * Get a file's mime-type.
  *
  * @param string $path path to file
  *
  * @throws FileNotFoundException
  *
  * @return string|false file mime-type or FALSE when fails
  *                      to fetch mime-type from existing file
  */
 public function getMimetype($path)
 {
     $path = Util::normalizePath($path);
     $this->assertPresent($path);
     if ($mimetype = $this->cache->getMimetype($path)) {
         return $mimetype;
     }
     if (!($object = $this->adapter->getMimetype($path))) {
         return false;
     }
     $object = $this->cache->updateObject($path, $object, true);
     return $object['mimetype'];
 }