Пример #1
0
 /**
  * {@inheritDoc}
  */
 public function getMimetype($pathOrUuid)
 {
     $path = $this->convertToPath($pathOrUuid);
     $this->guardNoInvalidUuid($pathOrUuid, $path);
     $this->guardInUploadPath($path);
     return $this->adapter->getMimetype($path);
 }
 /**
  * {@inheritdoc}
  */
 public function getMimetype($path)
 {
     if ($this->mainAdapter->has($path)) {
         return $this->mainAdapter->getMimetype($path);
     }
     return $this->fallback->getMimetype($path);
 }
Пример #3
0
 /**
  * {@inheritdoc}
  */
 public function getMimetype(string $path)
 {
     if (!$this->has($path)) {
         throw new FileNotFoundException($path);
     }
     $mimetype = $this->driver->getMimetype($path);
     return !$mimetype ?: $mimetype['mimetype'];
 }
Пример #4
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 (!($object = $this->adapter->getMimetype($path))) {
         return false;
     }
     return $object['mimetype'];
 }
Пример #5
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'];
 }
Пример #6
0
 /**
  * {@inheritdoc}
  */
 public function getMimetype($path)
 {
     return $this->adapter->getMimetype($this->getPath($path));
 }
Пример #7
0
 /**
  * {@inheritdoc}
  */
 public function getMimetype($path)
 {
     return $this->source->getMimetype($path);
 }