public function getApplicationName()Inherited
wild |
public static function initializeNewFile()
wild |
protected function getConfiguration()
wild |
public function generatePHID()
wild |
public function save()
wild |
public function saveAndIndex()
wild |
private function isIndexableFile()
wild |
public function getMonogram()
Get file monogram in the format of "F123"
string |
public function scrambleSecret()
wild |
public static function readUploadedFileData($spec)
$spec |
wild |
public static function newFromPHPUpload($spec, $params)
$spec | ||
array | $params |
wild |
public static function newFromXHRUpload($data, $params)
$data | ||
array | $params |
wild |
public static function newFileFromContentHash($hash, $params)
$hash | ||
array | $params |
wild |
public static function newChunkedFile($engine, $length, $params)
PhabricatorFileStorageEngine | $engine | |
$length | ||
array | $params |
wild |
private static function buildFromFileData($data, $params)
$data | ||
array | $params |
wild |
public static function newFromFileData($data, $params)
$data | ||
array | $params |
wild |
public function migrateToEngine($engine, $make_copy)
PhabricatorFileStorageEngine | $engine | |
$make_copy |
wild |
public function migrateToStorageFormat($format)
PhabricatorFileStorageFormat | $format |
wild |
public function cycleMasterStorageKey($format)
PhabricatorFileStorageFormat | $format |
wild |
private function writeToEngine($engine, $data, $params)
PhabricatorFileStorageEngine | $engine | |
$data | ||
array | $params |
wild |
public static function newFromFileDownload($uri, $params)
Download a remote resource over HTTP and save the response body as a file.
This method respects security.outbound-blacklist, and protects against HTTP redirection (by manually following "Location" headers and verifying each destination). It does not protect against DNS rebinding. See discussion in T6755.
$uri | ||
array | $params |
wild |
public static function normalizeFileName($file_name)
$file_name |
wild |
public function delete()
wild |
public function deleteFileDataIfUnused($engine, $engine_identifier, $handle)
Destroy stored file data if there are no remaining files which reference it.
PhabricatorFileStorageEngine | $engine | |
$engine_identifier | ||
$handle |
wild |
public static function hashFileContent($data)
$data |
wild |
public function loadFileData()
wild |
public function getFileDataIterator($begin, $end)
Return an iterable which emits file content bytes.
int | $begin | Offset for the start of data. |
int | $end | Offset for the end of data. |
Iterable | Iterable object which emits requested data. |
public function getURI()
Get file URI in the format of "/F123"
string |
public function getViewURI()
Get file view URI in the format of https://phorge.example.com/file/data/foo/PHID-FILE-bar/filename
string |
public function getCDNURI($request_kind)
Get file view URI in the format of https://phorge.example.com/file/data/foo/PHID-FILE-bar/filename or https://phorge.example.com/file/download/foo/PHID-FILE-bar/filename
$request_kind |
string |
public function getInfoURI()
Get file info URI in the format of "/F123"
string |
public function getBestURI()
wild |
public function getDownloadURI()
Get file view URI in the format of https://phorge.example.com/file/download/foo/PHID-FILE-bar/filename
string |
public function getURIForTransform($transform)
PhabricatorFileTransform | $transform |
wild |
private function getTransformedURI($transform)
$transform |
wild |
public function isViewableInBrowser()
Whether the file can be viewed in a browser
bool | True if MIME type of the file is listed in the files.viewable-mime-types setting |
public function isViewableImage()
Whether the file is an image viewable in the browser
bool | True if MIME type of the file is listed in the files.image-mime-types setting and file is viewable in the browser |
public function isAudio()
Whether the file is an audio file
bool | True if MIME type of the file is listed in the files.audio-mime-types setting and file is viewable in the browser |
public function isVideo()
Whether the file is a video file
bool | True if MIME type of the file is listed in the files.video-mime-types setting and file is viewable in the browser |
public function isPDF()
Whether the file is a PDF file
bool | True if MIME type of the file is application/pdf and file is viewable in the browser |
public function isTransformableImage()
wild |
public static function getTransformableImageFormats()
wild |
public function getDragAndDropDictionary()
wild |
public function instantiateStorageEngine()
wild |
public static function buildEngine($engine_identifier)
$engine_identifier |
wild |
public static function buildAllEngines()
wild |
public function getViewableMimeType()
Whether the file is listed as a viewable MIME type
bool | True if MIME type of the file is listed in the files.viewable-mime-types setting |
public function getDisplayIconForMimeType()
wild |
public function validateSecretKey($key)
$key |
wild |
public function generateSecretKey()
wild |
public function setStorageProperties($properties)
array | $properties |
wild |
public function getStorageProperties()
wild |
public function getStorageProperty($key, $default)
$key | ||
$default |
wild |
public function loadDataFromIterator($iterator)
$iterator |
wild |
public function updateDimensions($save)
$save |
wild |
public function copyDimensions($file)
PhabricatorFile | $file |
wild |
public static function loadBuiltins($user, $builtins)
Load (or build) the {@class:PhabricatorFile} objects for builtin file resources. The builtin mechanism allows files shipped with Phabricator to be treated like normal files so that APIs do not need to special case things like default images or deleted files.
Builtins are located in resources/builtin/ and identified by their name.
PhabricatorUser | $user | Viewing user. |
list<PhabricatorFilesBuiltinFile> | $builtins | List of builtin file specs. |
dict<string, PhabricatorFile> | Dictionary of named builtins. |
public static function loadBuiltin($user, $name)
Convenience wrapper for loadBuiltins().
PhabricatorUser | $user | Viewing user. |
string | $name | Single builtin name to load. |
PhabricatorFile | Corresponding builtin file. |
public function getObjects()
wild |
public function attachObjects($objects)
array | $objects |
wild |
public function getObjectPHIDs()
wild |
public function attachObjectPHIDs($object_phids)
array | $object_phids |
wild |
public function getOriginalFile()
wild |
public function attachOriginalFile($file)
PhabricatorFile | $file |
wild |
public function getImageHeight()
wild |
public function getImageWidth()
wild |
public function getAltText()
wild |
public function getCustomAltText()
wild |
public function setCustomAltText($value)
$value |
wild |
public function getDefaultAltText()
wild |
public function getCanCDN()
wild |
public function setCanCDN($can_cdn)
$can_cdn |
wild |
public function isBuiltin()
wild |
public function getBuiltinName()
wild |
public function setBuiltinName($name)
$name |
wild |
public function getIsProfileImage()
wild |
public function setIsProfileImage($value)
$value |
wild |
public function getIsChunk()
wild |
public function setIsChunk($value)
$value |
wild |
public function setIntegrityHash($integrity_hash)
$integrity_hash |
wild |
public function getIntegrityHash()
wild |
public function newIntegrityHash()
wild |
public function attachToObject($phid)
Write the policy edge between this file and some object. This method is successful even if the file is already attached.
phid | $phid | Object PHID to attach to. |
this |
public static function attachFileToObject($file_phid, $object_phid)
Write the policy edge between a file and some object. This method is successful even if the file is already attached.
phid | $file_phid | File PHID to attach from. |
phid | $object_phid | Object PHID to attach to. |
void |
private function readPropertiesFromParameters($params)
Configure a newly created file object according to specified parameters.
This method is called both when creating a file from fresh data, and when creating a new file which reuses existing storage.
map<string, | $params | wild> Bag of parameters, see @{class:PhabricatorFile} for documentation. |
this |
public function getRedirectResponse()
wild |
public function newDownloadResponse()
wild |
public function attachTransforms($map)
array | $map |
wild |
public function getTransform($key)
$key |
wild |
public function newStorageFormat()
wild |
public function getApplicationTransactionEditor()
wild |
public function getApplicationTransactionTemplate()
wild |
public function getCapabilities()
wild |
public function getPolicy($capability)
$capability |
wild |
public function hasAutomaticCapability($capability, $viewer)
$capability | ||
PhabricatorUser | $viewer |
wild |
public function describeAutomaticCapability($capability)
$capability |
wild |
public function isAutomaticallySubscribed($phid)
$phid |
wild |
public function getUsersToNotifyOfTokenGiven()
wild |
public function destroyObjectPermanently($engine)
PhabricatorDestructionEngine | $engine |
wild |
public function getFieldSpecificationsForConduit()
wild |
public function getFieldValuesForConduit()
wild |
public function getConduitSearchAttachments()
wild |
public function newNgrams()
wild |