Changeset View
Changeset View
Standalone View
Standalone View
src/applications/files/document/PhabricatorDocumentRef.php
Show First 20 Lines • Show All 62 Lines • ▼ Show 20 Lines | public function getLength() { | ||||
if ($this->file) { | if ($this->file) { | ||||
return (int)$this->file->getByteSize(); | return (int)$this->file->getByteSize(); | ||||
} | } | ||||
return null; | return null; | ||||
} | } | ||||
public function loadData() { | |||||
if ($this->file) { | |||||
return $this->file->loadFileData(); | |||||
} | |||||
throw new PhutilMethodNotImplementedException(); | |||||
} | |||||
public function hasAnyMimeType(array $candidate_types) { | public function hasAnyMimeType(array $candidate_types) { | ||||
$mime_full = $this->getMimeType(); | $mime_full = $this->getMimeType(); | ||||
$mime_parts = explode(';', $mime_full); | $mime_parts = explode(';', $mime_full); | ||||
$mime_type = head($mime_parts); | $mime_type = head($mime_parts); | ||||
$mime_type = $this->normalizeMimeType($mime_type); | $mime_type = $this->normalizeMimeType($mime_type); | ||||
foreach ($candidate_types as $candidate_type) { | foreach ($candidate_types as $candidate_type) { | ||||
Show All 15 Lines |