Changeset View
Changeset View
Standalone View
Standalone View
src/applications/files/storage/PhabricatorFile.php
Show First 20 Lines • Show All 924 Lines • ▼ Show 20 Lines | if (!$this->isViewableInBrowser()) { | ||||
return false; | return false; | ||||
} | } | ||||
$mime_map = PhabricatorEnv::getEnvConfig('files.video-mime-types'); | $mime_map = PhabricatorEnv::getEnvConfig('files.video-mime-types'); | ||||
$mime_type = $this->getMimeType(); | $mime_type = $this->getMimeType(); | ||||
return idx($mime_map, $mime_type); | return idx($mime_map, $mime_type); | ||||
} | } | ||||
public function isPDF() { | |||||
if (!$this->isViewableInBrowser()) { | |||||
return false; | |||||
} | |||||
$mime_map = array( | |||||
'application/pdf' => 'application/pdf', | |||||
); | |||||
$mime_type = $this->getMimeType(); | |||||
return idx($mime_map, $mime_type); | |||||
} | |||||
public function isTransformableImage() { | public function isTransformableImage() { | ||||
// NOTE: The way the 'gd' extension works in PHP is that you can install it | // NOTE: The way the 'gd' extension works in PHP is that you can install it | ||||
// with support for only some file types, so it might be able to handle | // with support for only some file types, so it might be able to handle | ||||
// PNG but not JPEG. Try to generate thumbnails for whatever we can. Setup | // PNG but not JPEG. Try to generate thumbnails for whatever we can. Setup | ||||
// warns you if you don't have complete support. | // warns you if you don't have complete support. | ||||
$matches = null; | $matches = null; | ||||
$ok = preg_match( | $ok = preg_match( | ||||
▲ Show 20 Lines • Show All 729 Lines • Show Last 20 Lines |