/** @var array */
protected $providers = [];
+ /** @var array mime type => support status */
+ protected $mimeTypeSupportMap = [];
+
/** @var array */
protected $defaultProviders;
return false;
}
+ if (isset($this->mimeTypeSupportMap[$mimeType])) {
+ return $this->mimeTypeSupportMap[$mimeType];
+ }
+
$providerMimeTypes = array_keys($this->providers);
foreach ($providerMimeTypes as $supportedMimeType) {
if (preg_match($supportedMimeType, $mimeType)) {
+ $this->mimeTypeSupportMap[$mimeType] = true;
return true;
}
}
+ $this->mimeTypeSupportMap[$mimeType] = false;
return false;
}
return false;
}
+ if (!$this->isMimeSupported($file->getMimetype())) {
+ return false;
+ }
+
$mount = $file->getMountPoint();
if ($mount and !$mount->getOption('previews', true)){
return false;