TYPO3
7.6
|
Public Member Functions | |
hasProperty ($key) | |
getProperty ($key) | |
getProperties () | |
getIdentifier () | |
getHashedIdentifier () | |
getName () | |
getNameWithoutExtension () | |
getSize () | |
getUid () | |
getSha1 () | |
getCreationTime () | |
getModificationTime () | |
getExtension () | |
getMimeType () | |
getType () | |
getContents () | |
setContents ($contents) | |
getStorage () | |
exists () | |
setStorage (ResourceStorage $storage) | |
setIdentifier ($identifier) | |
getCombinedIdentifier () | |
delete () | |
setDeleted () | |
isDeleted () | |
rename ($newName) | |
copyTo (Folder $targetFolder, $targetFileName=null, $conflictMode=DuplicationBehavior::RENAME) | |
moveTo (Folder $targetFolder, $targetFileName=null, $conflictMode=DuplicationBehavior::RENAME) | |
getPublicUrl ($relativeToCurrentScript=false) | |
getForLocalProcessing ($writable=true) | |
updateProperties (array $properties) | |
getParentFolder () | |
Public Member Functions inherited from FileInterface | |
isIndexed () | |
toArray () | |
Public Attributes | |
const | FILETYPE_UNKNOWN = 0 |
const | FILETYPE_TEXT = 1 |
const | FILETYPE_IMAGE = 2 |
const | FILETYPE_AUDIO = 3 |
const | FILETYPE_VIDEO = 4 |
const | FILETYPE_APPLICATION = 5 |
Protected Attributes | |
$properties | |
$storage = null | |
$identifier | |
$name | |
$deleted = false | |
Abstract file representation in the file abstraction layer.
Definition at line 22 of file AbstractFile.php.
copyTo | ( | Folder | $targetFolder, |
$targetFileName = null , |
|||
$conflictMode = DuplicationBehavior::RENAME |
|||
) |
Copies this file into a target folder
Folder | $targetFolder | Folder to copy file into. |
string | $targetFileName | an optional destination fileName |
string | $conflictMode | a value of the enumeration |
\RuntimeException |
Definition at line 486 of file AbstractFile.php.
References Folder\getStorage().
delete | ( | ) |
Deletes this file from its storage. This also means that this object becomes useless.
Implements FileInterface.
Definition at line 433 of file AbstractFile.php.
References AbstractFile\getStorage().
exists | ( | ) |
Checks if this file exists. This should normally always return TRUE; it might only return FALSE when this object has been created from an index record without checking for.
Definition at line 376 of file AbstractFile.php.
References AbstractFile\getIdentifier().
Referenced by ProcessedFile\needsReprocessing(), ProcessedFile\setName(), and ProcessedFile\updateProperties().
getCombinedIdentifier | ( | ) |
Returns a combined identifier of this file, i.e. the storage UID and the folder identifier separated by a colon ":".
Definition at line 418 of file AbstractFile.php.
References MathUtility\canBeInterpretedAsInteger(), AbstractFile\getIdentifier(), and AbstractFile\getStorage().
Referenced by File\calculateChecksum(), and File\toArray().
getContents | ( | ) |
Get the contents of this file
\RuntimeException |
Implements FileInterface.
Definition at line 326 of file AbstractFile.php.
References AbstractFile\getStorage().
getCreationTime | ( | ) |
Returns the creation time of the file as Unix timestamp
\RuntimeException |
Implements FileInterface.
Definition at line 225 of file AbstractFile.php.
References AbstractFile\getProperty().
getExtension | ( | ) |
Get the extension of this file in a lower-case variant
Implements FileInterface.
Definition at line 252 of file AbstractFile.php.
References AbstractFile\getName(), and PathUtility\pathinfo().
Referenced by ImageService\getCompatibilityImageResourceValues(), OnlineMediaHelperRegistry\getOnlineMediaHelper(), and File\toArray().
getForLocalProcessing | ( | $writable = true | ) |
Returns a path to a local version of this file to process it locally (e.g. with some system tool). If the file is normally located on a remote storages, this creates a local copy. If the file is already on the local system, this only makes a new copy if $writable is set to TRUE.
bool | $writable | Set this to FALSE if you only want to do read operations on the file. |
\RuntimeException |
Implements FileInterface.
Definition at line 543 of file AbstractFile.php.
References AbstractFile\getStorage().
Referenced by Indexer\extractRequiredMetaData(), MetaDataRepository\findByFile(), and SelectImage\insertPlainImage().
getHashedIdentifier | ( | ) |
Get hashed identifier
Implements ResourceInterface.
Definition at line 154 of file AbstractFile.php.
getIdentifier | ( | ) |
Returns the identifier of this file
Implements ResourceInterface.
Definition at line 144 of file AbstractFile.php.
References AbstractFile\$identifier.
Referenced by AbstractFile\exists(), AbstractFile\getCombinedIdentifier(), AbstractFile\getMimeType(), AbstractFile\getParentFolder(), AbstractFile\getSize(), ResourceStorage\setFileContents(), and Indexer\updateIndexEntry().
getMimeType | ( | ) |
Get the MIME type of this file
Implements FileInterface.
Definition at line 266 of file AbstractFile.php.
References AbstractFile\getIdentifier(), and AbstractFile\getStorage().
Referenced by File\calculateChecksum(), AbstractFile\getType(), and File\toArray().
getModificationTime | ( | ) |
Returns the date (as UNIX timestamp) the file was last modified.
\RuntimeException |
Implements FileInterface.
Definition at line 239 of file AbstractFile.php.
References AbstractFile\getProperty().
getName | ( | ) |
Returns the name of this file
Implements ResourceInterface.
Definition at line 164 of file AbstractFile.php.
References AbstractFile\$name.
Referenced by AbstractFile\getExtension(), AbstractFile\getNameWithoutExtension(), and File\toArray().
getNameWithoutExtension | ( | ) |
Returns the basename (the name without extension) of this file.
Implements FileInterface.
Definition at line 176 of file AbstractFile.php.
References AbstractFile\getName(), and PathUtility\pathinfo().
getParentFolder | ( | ) |
Returns the parent folder.
Implements ResourceInterface.
Definition at line 568 of file AbstractFile.php.
References AbstractFile\getIdentifier(), and AbstractFile\getStorage().
getProperties | ( | ) |
Returns the properties of this object.
Definition at line 134 of file AbstractFile.php.
References AbstractFile\$properties.
getProperty | ( | $key | ) |
Returns a property value
string | $key |
Implements FileInterface.
Definition at line 120 of file AbstractFile.php.
References AbstractFile\hasProperty().
Referenced by AbstractFile\getCreationTime(), AbstractFile\getModificationTime(), and AbstractFile\getUid().
getPublicUrl | ( | $relativeToCurrentScript = false | ) |
Returns a publicly accessible URL for this file
WARNING: Access to the file may be restricted by further means, e.g. some web-based authentication. You have to take care of this yourself.
bool | $relativeToCurrentScript | Determines whether the URL returned should be relative to the current script, in case it is relative at all (only for the LocalDriver) |
Implements FileInterface.
Definition at line 524 of file AbstractFile.php.
References AbstractFile\getStorage().
getSha1 | ( | ) |
Returns the Sha1 of this file
\RuntimeException |
Implements FileInterface.
Definition at line 211 of file AbstractFile.php.
References AbstractFile\getStorage().
getSize | ( | ) |
Returns the size of this file
\RuntimeException |
Implements FileInterface.
Definition at line 187 of file AbstractFile.php.
References AbstractFile\getIdentifier(), and AbstractFile\getStorage().
Referenced by File\toArray().
getStorage | ( | ) |
Get the storage this file is located in
\RuntimeException |
Implements ResourceInterface.
Definition at line 361 of file AbstractFile.php.
References AbstractFile\$storage.
Referenced by ProcessedFile\__construct(), File\checkActionPermission(), AbstractFile\delete(), MetaDataRepository\findByFile(), AbstractFile\getCombinedIdentifier(), File\getContents(), AbstractFile\getContents(), AbstractFile\getForLocalProcessing(), AbstractFile\getMimeType(), AbstractFile\getParentFolder(), File\getPublicUrl(), AbstractFile\getPublicUrl(), ProcessedFile\getPublicUrl(), AbstractFile\getSha1(), AbstractFile\getSize(), FileIndexRepository\getWhereClauseForFile(), File\process(), AbstractFile\rename(), File\setContents(), AbstractFile\setContents(), File\toArray(), and ProcessedFile\toArray().
getType | ( | ) |
Returns the fileType of this file basically there are only five main "file types" "audio" "image" "software" "text" "video" "other" see the constants in this class
Definition at line 284 of file AbstractFile.php.
References AbstractFile\getMimeType().
Referenced by Indexer\extractRequiredMetaData(), MetaDataRepository\findByFile(), File\toArray(), and File\updateProperties().
getUid | ( | ) |
Returns the uid of this file
Definition at line 200 of file AbstractFile.php.
References AbstractFile\getProperty().
Referenced by Indexer\extractMetaData(), Indexer\extractRequiredMetaData(), MetaDataRepository\findByFile(), AbstractOnlineMediaHelper\getOnlineMediaId(), FileIndexRepository\getWhereClauseForFile(), File\toArray(), and FileIndexRepository\update().
hasProperty | ( | $key | ) |
Returns true if the given property key exists for this file.
string | $key |
Implements FileInterface.
Definition at line 109 of file AbstractFile.php.
Referenced by AbstractFile\getProperty().
isDeleted | ( | ) |
Returns TRUE if this file has been deleted
Definition at line 455 of file AbstractFile.php.
References AbstractFile\$deleted.
moveTo | ( | Folder | $targetFolder, |
$targetFileName = null , |
|||
$conflictMode = DuplicationBehavior::RENAME |
|||
) |
Moves the file into the target folder
Folder | $targetFolder | Folder to move file into. |
string | $targetFileName | an optional destination fileName |
string | $conflictMode | a value of the enumeration |
\RuntimeException |
Definition at line 504 of file AbstractFile.php.
References Folder\getStorage().
rename | ( | $newName | ) |
Renames this file.
string | $newName | The new file name |
\RuntimeException |
Implements FileInterface.
Definition at line 468 of file AbstractFile.php.
References AbstractFile\getStorage().
setContents | ( | $contents | ) |
Replace the current file contents with the given string
string | $contents | The contents to write to the file. |
\RuntimeException |
Implements FileInterface.
Definition at line 342 of file AbstractFile.php.
References AbstractFile\getStorage().
setDeleted | ( | ) |
Marks this file as deleted. This should only be used inside the File Abstraction Layer, as it is a low-level API method.
Definition at line 445 of file AbstractFile.php.
setIdentifier | ( | $identifier | ) |
Set the identifier of this file
Definition at line 406 of file AbstractFile.php.
References AbstractFile\$identifier.
Referenced by ResourceStorage\updateProcessedFile().
setStorage | ( | ResourceStorage | $storage | ) |
Sets the storage this file is located in. This is only meant for -internal usage; don't use it to move files.
Definition at line 392 of file AbstractFile.php.
References AbstractFile\$storage, and ResourceStorage\getUid().
|
abstract |
Updates properties of this object. This method is used to reconstitute settings from the database into this object after being intantiated.
array | $properties |
|
protected |
Definition at line 63 of file AbstractFile.php.
Referenced by AbstractFile\isDeleted().
|
protected |
Definition at line 49 of file AbstractFile.php.
Referenced by AbstractFile\getIdentifier(), and AbstractFile\setIdentifier().
|
protected |
Definition at line 56 of file AbstractFile.php.
Referenced by ProcessedFile\generateProcessedFileNameWithoutExtension(), AbstractFile\getName(), ProcessedFile\getName(), and ProcessedFile\setName().
|
protected |
Definition at line 33 of file AbstractFile.php.
Referenced by AbstractFile\getProperties(), and ProcessedFile\toArray().
|
protected |
Definition at line 40 of file AbstractFile.php.
Referenced by File\__construct(), AbstractFile\getStorage(), and AbstractFile\setStorage().
const FILETYPE_APPLICATION = 5 |
Any kind of application
Definition at line 98 of file AbstractFile.php.
Referenced by Indexer\getFileType().
const FILETYPE_AUDIO = 3 |
Any kind of audio file
Definition at line 86 of file AbstractFile.php.
Referenced by Indexer\getFileType().
const FILETYPE_IMAGE = 2 |
Any kind of image
Definition at line 80 of file AbstractFile.php.
Referenced by Indexer\extractRequiredMetaData(), MetaDataRepository\findByFile(), Indexer\getFileType(), and ThumbnailView\main().
const FILETYPE_TEXT = 1 |
Any kind of text
Definition at line 74 of file AbstractFile.php.
Referenced by Indexer\getFileType().
const FILETYPE_UNKNOWN = 0 |
const FILETYPE_VIDEO = 4 |
Any kind of video
Definition at line 92 of file AbstractFile.php.
Referenced by Indexer\getFileType().