TYPO3
7.6
|
Public Member Functions | |
__construct (Driver\DriverInterface $driver, array $storageRecord) | |
getConfiguration () | |
setConfiguration (array $configuration) | |
getStorageRecord () | |
setDriver (Driver\DriverInterface $driver) | |
getName () | |
getUid () | |
hasChildren () | |
getCapabilities () | |
isPublic () | |
isWritable () | |
isBrowsable () | |
usesCaseSensitiveIdentifiers () | |
isOnline () | |
autoExtractMetadataEnabled () | |
markAsPermanentlyOffline () | |
markAsTemporaryOffline () | |
addFileMount ($folderIdentifier, $additionalData=array()) | |
getFileMounts () | |
isWithinFileMountBoundaries ($subject, $checkWriteAccess=false) | |
setEvaluatePermissions ($evaluatePermissions) | |
getEvaluatePermissions () | |
setUserPermissions (array $userPermissions) | |
checkUserActionPermission ($action, $type) | |
checkFileActionPermission ($action, FileInterface $file) | |
checkFolderActionPermission ($action, Folder $folder=null) | |
sanitizeFileName ($fileName, Folder $targetFolder=null) | |
addFile ($localFilePath, Folder $targetFolder, $targetFileName= '', $conflictMode=DuplicationBehavior::RENAME) | |
updateProcessedFile ($localFilePath, ProcessedFile $processedFile, Folder $processingFolder=null) | |
hashFile (FileInterface $fileObject, $hash) | |
hashFileByIdentifier ($fileIdentifier, $hash) | |
getPublicUrl (ResourceInterface $resourceObject, $relativeToCurrentScript=false) | |
processFile (FileInterface $fileObject, $context, array $configuration) | |
getFileForLocalProcessing (FileInterface $fileObject, $writable=true) | |
getFile ($identifier) | |
getFileInfo (FileInterface $fileObject) | |
getFileInfoByIdentifier ($identifier, array $propertiesToExtract=array()) | |
unsetFileAndFolderNameFilters () | |
resetFileAndFolderNameFiltersToDefault () | |
getFileAndFolderNameFilters () | |
setFileAndFolderNameFilters (array $filters) | |
addFileAndFolderNameFilter ($filter) | |
getFolderIdentifierFromFileIdentifier ($fileIdentifier) | |
getFileInFolder ($fileName, Folder $folder) | |
getFilesInFolder (Folder $folder, $start=0, $maxNumberOfItems=0, $useFilters=true, $recursive=false, $sort= '', $sortRev=false) | |
getFileIdentifiersInFolder ($folderIdentifier, $useFilters=true, $recursive=false) | |
countFilesInFolder (Folder $folder, $useFilters=true, $recursive=false) | |
getFolderIdentifiersInFolder ($folderIdentifier, $useFilters=true, $recursive=false) | |
hasFile ($identifier) | |
isProcessingFolder (Folder $folder) | |
hasFileInFolder ($fileName, Folder $folder) | |
getFileContents ($file) | |
dumpFileContents (FileInterface $file, $asDownload=false, $alternativeFilename=null, $overrideMimeType=null) | |
setFileContents (AbstractFile $file, $contents) | |
createFile ($fileName, Folder $targetFolderObject) | |
deleteFile ($fileObject) | |
copyFile (FileInterface $file, Folder $targetFolder, $targetFileName=null, $conflictMode=DuplicationBehavior::RENAME) | |
moveFile ($file, $targetFolder, $targetFileName=null, $conflictMode=DuplicationBehavior::RENAME) | |
renameFile ($file, $targetFileName) | |
replaceFile (FileInterface $file, $localFilePath) | |
addUploadedFile (array $uploadedFileData, Folder $targetFolder=null, $targetFileName=null, $conflictMode=DuplicationBehavior::CANCEL) | |
moveFolder (Folder $folderToMove, Folder $targetParentFolder, $newFolderName=null, $conflictMode=DuplicationBehavior::RENAME) | |
copyFolder (FolderInterface $folderToCopy, FolderInterface $targetParentFolder, $newFolderName=null, $conflictMode=DuplicationBehavior::RENAME) | |
renameFolder ($folderObject, $newName) | |
deleteFolder ($folderObject, $deleteRecursively=false) | |
getFolderInFolder ($folderName, Folder $parentFolder, $returnInaccessibleFolderObject=false) | |
getFoldersInFolder (Folder $folder, $start=0, $maxNumberOfItems=0, $useFilters=true, $recursive=false, $sort= '', $sortRev=false) | |
countFoldersInFolder (Folder $folder, $useFilters=true, $recursive=false) | |
hasFolder ($identifier) | |
hasFolderInFolder ($folderName, Folder $folder) | |
createFolder ($folderName, Folder $parentFolder=null) | |
getDefaultFolder () | |
getFolder ($identifier, $returnInaccessibleFolderObject=false) | |
isWithinProcessingFolder ($identifier) | |
isWithinFolder (Folder $folder, ResourceInterface $resource) | |
getRootLevelFolder ($respectFileMounts=true) | |
getRole (FolderInterface $folder) | |
getProcessingFolder () | |
getDriverType () | |
setDefault ($isDefault) | |
isDefault () | |
Protected Attributes | |
$driver | |
$storageRecord | |
$configuration | |
$fileProcessingService | |
$evaluatePermissions = false | |
$fileMounts = array() | |
$userPermissions = array() | |
$capabilities | |
$signalSlotDispatcher | |
$processingFolder | |
$processingFolders | |
$isOnline = null | |
$isDefault = false | |
$fileAndFolderNameFilters = array() | |
Additional Inherited Members | |
Public Attributes inherited from ResourceStorageInterface | |
const | SIGNAL_SanitizeFileName = 'sanitizeFileName' |
const | SIGNAL_PreFileAdd = 'preFileAdd' |
const | SIGNAL_PostFileAdd = 'postFileAdd' |
const | SIGNAL_PostFileCreate = 'postFileCreate' |
const | SIGNAL_PreFileCopy = 'preFileCopy' |
const | SIGNAL_PostFileCopy = 'postFileCopy' |
const | SIGNAL_PreFileMove = 'preFileMove' |
const | SIGNAL_PostFileMove = 'postFileMove' |
const | SIGNAL_PreFileDelete = 'preFileDelete' |
const | SIGNAL_PostFileDelete = 'postFileDelete' |
const | SIGNAL_PreFileRename = 'preFileRename' |
const | SIGNAL_PostFileRename = 'postFileRename' |
const | SIGNAL_PreFileReplace = 'preFileReplace' |
const | SIGNAL_PostFileReplace = 'postFileReplace' |
const | SIGNAL_PostFileSetContents = 'postFileSetContents' |
const | SIGNAL_PreFolderAdd = 'preFolderAdd' |
const | SIGNAL_PostFolderAdd = 'postFolderAdd' |
const | SIGNAL_PreFolderCopy = 'preFolderCopy' |
const | SIGNAL_PostFolderCopy = 'postFolderCopy' |
const | SIGNAL_PreFolderMove = 'preFolderMove' |
const | SIGNAL_PostFolderMove = 'postFolderMove' |
const | SIGNAL_PreFolderDelete = 'preFolderDelete' |
const | SIGNAL_PostFolderDelete = 'postFolderDelete' |
const | SIGNAL_PreFolderRename = 'preFolderRename' |
const | SIGNAL_PostFolderRename = 'postFolderRename' |
const | SIGNAL_PreGeneratePublicUrl = 'preGeneratePublicUrl' |
const | CAPABILITY_BROWSABLE = 1 |
const | CAPABILITY_PUBLIC = 2 |
const | CAPABILITY_WRITABLE = 4 |
const | DEFAULT_ProcessingFolder = '_processed_' |
A "mount point" inside the TYPO3 file handling.
A "storage" object handles
== Driver entry point The driver itself, that does the actual work on the file system, is inside the storage but completely shadowed by the storage, as the storage also handles the abstraction to the driver
The storage can be on the local system, but can also be on a remote system. The combination of driver + configurable capabilities (storage is read-only e.g.) allows for flexible uses.
== Permission system As all requests have to run through the storage, the storage knows about the permissions of a BE/FE user, the file permissions / limitations of the driver and has some configurable capabilities. Additionally, a BE user can use "filemounts" (known from previous installations) to limit his/her work-zone to only a subset (identifier and its subfolders/subfolders) of the user itself.
Check 1: "User Permissions" [is the user allowed to write a file) [is the user allowed to write a file] Check 2: "File Mounts" of the User (act as subsets / filters to the identifiers) [is the user allowed to do something in this folder?] Check 3: "Capabilities" of Storage (then: of Driver) [is the storage/driver writable?] Check 4: "File permissions" of the Driver [is the folder writable?]
Definition at line 56 of file ResourceStorage.php.
__construct | ( | Driver\DriverInterface | $driver, |
array | $storageRecord | ||
) |
Constructor for a storage object.
Driver\DriverInterface | $driver | |
array | $storageRecord | The storage record row from the database |
Definition at line 159 of file ResourceStorage.php.
References ResourceStorage\$driver, ResourceStorage\$storageRecord, ResourceFactory\getInstance(), ResourceStorage\isDefault(), ResourceStorage\markAsPermanentlyOffline(), and ResourceStorage\resetFileAndFolderNameFiltersToDefault().
addFile | ( | $localFilePath, | |
Folder | $targetFolder, | ||
$targetFileName = '' , |
|||
$conflictMode = DuplicationBehavior::RENAME |
|||
) |
Moves a file from the local filesystem to this storage.
string | $localFilePath | The file on the server's hard disk to add |
Folder | $targetFolder | The target folder where the file should be added |
string | $targetFileName | The name of the file to be add, If not set, the local file name is used |
string | $conflictMode | a value of the enumeration |
\InvalidArgumentException | |
Exception\ExistingTargetFileNameException |
Definition at line 1152 of file ResourceStorage.php.
References ResourceStorage\assureFileAddPermissions(), ResourceStorage\autoExtractMetadataEnabled(), PathUtility\basename(), DuplicationBehavior\CANCEL, Enumeration\cast(), elseif, ResourceStorage\emitPostFileAddSignal(), ResourceStorage\emitPreFileAddSignal(), PathUtility\getCanonicalPath(), ResourceStorage\getDefaultFolder(), Folder\getIdentifier(), ResourceFactory\getInstance(), ResourceStorage\getUid(), ResourceStorage\getUniqueName(), GeneralUtility\makeInstance(), DuplicationBehavior\RENAME, and ResourceStorage\sanitizeFileName().
Referenced by ResourceStorage\addUploadedFile().
addFileAndFolderNameFilter | ( | $filter | ) |
array | $filter |
Definition at line 1425 of file ResourceStorage.php.
addFileMount | ( | $folderIdentifier, | |
$additionalData = array() |
|||
) |
Adds a filemount as a "filter" for users to only work on a subset of a storage object
string | $folderIdentifier | |
array | $additionalData |
Exception\FolderDoesNotExistException |
Definition at line 428 of file ResourceStorage.php.
References ResourceFactory\getInstance().
Referenced by StoragePermissionsAspect\addFileMountsToStorage().
addUploadedFile | ( | array | $uploadedFileData, |
Folder | $targetFolder = null , |
||
$targetFileName = null , |
|||
$conflictMode = DuplicationBehavior::CANCEL |
|||
) |
Adds an uploaded file into the Storage. Previously in ::file_upload()
array | $uploadedFileData | contains information about the uploaded file given by $_FILES['file1'] |
Folder | $targetFolder | the target folder |
string | $targetFileName | the file name to be written |
string | $conflictMode | a value of the enumeration |
Definition at line 1915 of file ResourceStorage.php.
References ResourceStorage\addFile(), ResourceStorage\assureFileUploadPermissions(), Enumeration\cast(), ResourceStorage\getDefaultFolder(), ResourceStorage\getFileInFolder(), ResourceStorage\hasFileInFolder(), DuplicationBehavior\REPLACE, and ResourceStorage\replaceFile().
|
protected |
Checks if a file/user has the permission to be written to a Folder/Storage. If not, throws an exception.
Folder | $targetFolder | The target folder where the file should be written |
string | $targetFileName | The file name which should be written into the storage |
Exception\InsufficientFolderWritePermissionsException | |
Exception\IllegalFileExtensionException | |
Exception\InsufficientUserPermissionsException |
Definition at line 895 of file ResourceStorage.php.
References ResourceStorage\checkFileExtensionPermission(), ResourceStorage\checkFolderActionPermission(), ResourceStorage\checkUserActionPermission(), and ResourceStorage\getUid().
Referenced by ResourceStorage\addFile(), ResourceStorage\assureFileUploadPermissions(), and ResourceStorage\createFile().
|
protected |
Check if a file has the permission to be copied on a File/Folder/Storage, if not throw an exception
FileInterface | $file | |
Folder | $targetFolder | |
string | $targetFileName |
Exception | |
Exception\InsufficientFolderWritePermissionsException | |
Exception\IllegalFileExtensionException | |
Exception\InsufficientFileReadPermissionsException | |
Exception\InsufficientUserPermissionsException |
Definition at line 1019 of file ResourceStorage.php.
References ResourceStorage\checkFileExtensionPermission(), ResourceStorage\checkFolderActionPermission(), ResourceInterface\getIdentifier(), Folder\getIdentifier(), ResourceInterface\getName(), ResourceInterface\getStorage(), Folder\getStorage(), and ResourceStorage\getUid().
|
protected |
Assures delete permission for given file.
FileInterface | $file |
Exception\IllegalFileExtensionException | |
Exception\InsufficientFileWritePermissionsException | |
Exception\InsufficientFolderWritePermissionsException |
Definition at line 862 of file ResourceStorage.php.
References ResourceStorage\checkFileActionPermission(), ResourceStorage\checkFileExtensionPermission(), ResourceStorage\checkUserActionPermission(), FileInterface\getExtension(), ResourceInterface\getIdentifier(), and ResourceInterface\getName().
Referenced by ResourceStorage\deleteFile().
|
protected |
Checks for permissions to move a file.
\RuntimeException | |
Exception\InsufficientFolderAccessPermissionsException | |
Exception\InsufficientUserPermissionsException | |
Exception\IllegalFileExtensionException |
FileInterface | $file | |
Folder | $targetFolder | |
string | $targetFileName |
Definition at line 954 of file ResourceStorage.php.
References ResourceStorage\checkFileExtensionPermission(), ResourceStorage\checkFolderActionPermission(), Folder\getIdentifier(), ResourceInterface\getStorage(), Folder\getStorage(), and ResourceStorage\getUid().
Referenced by ResourceStorage\moveFile().
|
protected |
Assures read permission for given file.
FileInterface | $file |
Exception\InsufficientFileAccessPermissionsException | |
Exception\IllegalFileExtensionException |
Definition at line 797 of file ResourceStorage.php.
References ResourceStorage\checkFileActionPermission(), ResourceStorage\checkFileExtensionPermission(), and ResourceInterface\getName().
Referenced by ResourceStorage\getFileContents().
|
protected |
Checks for permissions to rename a file.
FileInterface | $file | |
string | $targetFileName |
Exception\InsufficientFileWritePermissionsException | |
Exception\IllegalFileExtensionException | |
Exception\InsufficientFileReadPermissionsException | |
Exception\InsufficientUserPermissionsException |
Definition at line 985 of file ResourceStorage.php.
References ResourceStorage\checkFileActionPermission(), ResourceStorage\checkFileExtensionPermission(), ResourceStorage\checkFolderActionPermission(), and ResourceInterface\getName().
Referenced by ResourceStorage\renameFile().
|
protected |
Assure replace permission for given file.
FileInterface | $file |
Exception\InsufficientFileWritePermissionsException | |
Exception\InsufficientFolderWritePermissionsException |
Definition at line 841 of file ResourceStorage.php.
References ResourceStorage\checkFileActionPermission(), ResourceStorage\checkFolderActionPermission(), ResourceInterface\getIdentifier(), and ResourceInterface\getParentFolder().
Referenced by ResourceStorage\replaceFile().
|
protected |
Checks if a file has the permission to be uploaded to a Folder/Storage. If not, throws an exception.
string | $localFilePath | the temporary file name from $_FILES['file1']['tmp_name'] |
Folder | $targetFolder | The target folder where the file should be uploaded |
string | $targetFileName | the destination file name $_FILES['file1']['name'] |
int | $uploadedFileSize |
Exception\InsufficientFolderWritePermissionsException | |
Exception\UploadException | |
Exception\IllegalFileExtensionException | |
Exception\UploadSizeException | |
Exception\InsufficientUserPermissionsException |
Definition at line 927 of file ResourceStorage.php.
References ResourceStorage\assureFileAddPermissions(), and GeneralUtility\getMaxUploadFileSize().
Referenced by ResourceStorage\addUploadedFile().
|
protected |
Assures write permission for given file.
FileInterface | $file |
Exception\IllegalFileExtensionException | |
Exception\InsufficientFileWritePermissionsException | |
Exception\InsufficientUserPermissionsException |
Definition at line 822 of file ResourceStorage.php.
References ResourceStorage\checkFileActionPermission(), ResourceStorage\checkFileExtensionPermission(), FileInterface\getExtension(), ResourceInterface\getIdentifier(), and ResourceInterface\getName().
Referenced by ResourceStorage\setFileContents().
|
protected |
Check if a file has the permission to be copied on a File/Folder/Storage, if not throw an exception
FolderInterface | $folderToCopy | |
FolderInterface | $targetParentFolder |
Exception | |
Exception\InsufficientFolderWritePermissionsException | |
Exception\IllegalFileExtensionException | |
Exception\InsufficientFileReadPermissionsException | |
Exception\InsufficientUserPermissionsException | |
\RuntimeException |
Definition at line 1054 of file ResourceStorage.php.
References ResourceStorage\checkFolderActionPermission(), ResourceInterface\getIdentifier(), ResourceInterface\getStorage(), and ResourceStorage\getUid().
Referenced by ResourceStorage\copyFolder().
|
protected |
Assures delete permission for given folder.
Folder | $folder | If a folder is given, mountpoints are checked. If not only user folder delete permissions are checked. |
bool | $checkDeleteRecursively |
Exception\InsufficientFolderAccessPermissionsException | |
Exception\InsufficientFolderWritePermissionsException | |
Exception\InsufficientUserPermissionsException |
Definition at line 768 of file ResourceStorage.php.
References ResourceStorage\checkFolderActionPermission(), ResourceStorage\checkUserActionPermission(), and Folder\getName().
Referenced by ResourceStorage\deleteFolder().
|
protected |
Check if a file has the permission to be copied on a File/Folder/Storage, if not throw an exception
FolderInterface | $folderToMove | |
FolderInterface | $targetParentFolder |
\InvalidArgumentException | |
Exception\InsufficientFolderWritePermissionsException | |
Exception\IllegalFileExtensionException | |
Exception\InsufficientFileReadPermissionsException | |
Exception\InsufficientUserPermissionsException | |
\RuntimeException |
Definition at line 1091 of file ResourceStorage.php.
References ResourceStorage\checkFolderActionPermission(), ResourceInterface\getIdentifier(), ResourceInterface\getStorage(), and ResourceStorage\getUid().
Referenced by ResourceStorage\moveFolder().
|
protected |
Assures read permission for given folder.
Folder | $folder | If a folder is given, mountpoints are checked. If not only user folder read permissions are checked. |
Exception\InsufficientFolderAccessPermissionsException |
Definition at line 741 of file ResourceStorage.php.
References ResourceStorage\checkFolderActionPermission().
Referenced by ResourceStorage\countFilesInFolder(), ResourceStorage\countFoldersInFolder(), ResourceStorage\getFilesInFolder(), ResourceStorage\getFolder(), ResourceStorage\hasFile(), ResourceStorage\hasFileInFolder(), ResourceStorage\hasFolder(), and ResourceStorage\hasFolderInFolder().
autoExtractMetadataEnabled | ( | ) |
Returns TRUE if auto extracting of metadata is enabled
Definition at line 375 of file ResourceStorage.php.
Referenced by ResourceStorage\addFile(), and ResourceStorage\replaceFile().
checkFileActionPermission | ( | $action, | |
FileInterface | $file | ||
) |
Checks if a file operation (= action) is allowed on a File/Folder/Storage (= subject).
This method, by design, does not throw exceptions or do logging. Besides the usage from other methods in this class, it is also used by the Filelist UI to check whether an action is allowed and whether action related UI elements should thus be shown (move icon, edit icon, etc.)
string | $action | action, can be read, write, delete |
FileInterface | $file |
Definition at line 583 of file ResourceStorage.php.
References ResourceStorage\checkFileExtensionPermission(), ResourceStorage\checkUserActionPermission(), ResourceInterface\getIdentifier(), ResourceInterface\getName(), ResourceStorage\isWithinFileMountBoundaries(), and ResourceStorage\isWritable().
Referenced by ResourceStorage\assureFileDeletePermissions(), ResourceStorage\assureFileReadPermission(), ResourceStorage\assureFileRenamePermissions(), ResourceStorage\assureFileReplacePermissions(), and ResourceStorage\assureFileWritePermissions().
|
protected |
If the fileName is given, checks it against the TYPO3_CONF_VARS[BE][fileDenyPattern] + and if the file extension is allowed.
string | $fileName | full filename |
Definition at line 697 of file ResourceStorage.php.
References $GLOBALS, GeneralUtility\inList(), PathUtility\pathinfo(), GeneralUtility\uniqueList(), and GeneralUtility\verifyFilenameAgainstDenyPattern().
Referenced by ResourceStorage\assureFileAddPermissions(), ResourceStorage\assureFileCopyPermissions(), ResourceStorage\assureFileDeletePermissions(), ResourceStorage\assureFileMovePermissions(), ResourceStorage\assureFileReadPermission(), ResourceStorage\assureFileRenamePermissions(), ResourceStorage\assureFileWritePermissions(), ResourceStorage\checkFileActionPermission(), and ResourceStorage\replaceFile().
checkFolderActionPermission | ( | $action, | |
Folder | $folder = null |
||
) |
Checks if a folder operation (= action) is allowed on a Folder.
This method, by design, does not throw exceptions or do logging. See the checkFileActionPermission() method above for the reasons.
string | $action | |
Folder | $folder |
Definition at line 646 of file ResourceStorage.php.
References ResourceStorage\checkUserActionPermission(), ResourceStorage\isBrowsable(), ResourceStorage\isWithinFileMountBoundaries(), and ResourceStorage\isWritable().
Referenced by ResourceStorage\assureFileAddPermissions(), ResourceStorage\assureFileCopyPermissions(), ResourceStorage\assureFileMovePermissions(), ResourceStorage\assureFileRenamePermissions(), ResourceStorage\assureFileReplacePermissions(), ResourceStorage\assureFolderCopyPermissions(), ResourceStorage\assureFolderDeletePermission(), ResourceStorage\assureFolderMovePermissions(), ResourceStorage\assureFolderReadPermission(), ResourceStorage\createFolder(), and ResourceStorage\renameFolder().
checkUserActionPermission | ( | $action, | |
$type | |||
) |
Checks if the ACL settings allow for a certain action (is a user allowed to read a file or copy a folder).
Definition at line 556 of file ResourceStorage.php.
Referenced by ResourceStorage\assureFileAddPermissions(), ResourceStorage\assureFileDeletePermissions(), ResourceStorage\assureFolderDeletePermission(), ResourceStorage\checkFileActionPermission(), and ResourceStorage\checkFolderActionPermission().
copyFile | ( | FileInterface | $file, |
Folder | $targetFolder, | ||
$targetFileName = null , |
|||
$conflictMode = DuplicationBehavior::RENAME |
|||
) |
Previously in ::func_copy() copies a source file (from any location) in to the target folder, the latter has to be part of this storage
FileInterface | $file | |
Folder | $targetFolder | |
string | $targetFileName | an optional destination fileName |
string | $conflictMode | a value of the enumeration |
\Exception|Exception\AbstractFileOperationException | |
Exception\ExistingTargetFileNameException |
Definition at line 1745 of file ResourceStorage.php.
copyFolder | ( | FolderInterface | $folderToCopy, |
FolderInterface | $targetParentFolder, | ||
$newFolderName = null , |
|||
$conflictMode = DuplicationBehavior::RENAME |
|||
) |
Copies a folder.
FolderInterface | $folderToCopy | The folder to copy |
FolderInterface | $targetParentFolder | The target folder |
string | $newFolderName | |
string | $conflictMode | a value of the enumeration |
InvalidTargetFolderException |
Definition at line 2041 of file ResourceStorage.php.
References ResourceStorage\assureFolderCopyPermissions(), ResourceStorage\copyFolderBetweenStorages(), ResourceStorage\emitPostFolderCopySignal(), ResourceStorage\emitPreFolderCopySignal(), ResourceStorage\getFolder(), ResourceInterface\getIdentifier(), ResourceInterface\getName(), ResourceInterface\getStorage(), FolderInterface\getSubfolder(), and ResourceStorage\isWithinFolder().
|
protected |
Copies a folder between storages.
\RuntimeException |
Definition at line 2083 of file ResourceStorage.php.
Referenced by ResourceStorage\copyFolder().
countFilesInFolder | ( | Folder | $folder, |
$useFilters = true , |
|||
$recursive = false |
|||
) |
Folder | $folder | |
bool | $useFilters | |
bool | $recursive |
Exception\InsufficientFolderAccessPermissionsException |
Definition at line 1515 of file ResourceStorage.php.
References ResourceStorage\assureFolderReadPermission(), and Folder\getIdentifier().
countFoldersInFolder | ( | Folder | $folder, |
$useFilters = true , |
|||
$recursive = false |
|||
) |
Folder | $folder | |
bool | $useFilters | |
bool | $recursive |
Exception\InsufficientFolderAccessPermissionsException |
Definition at line 2219 of file ResourceStorage.php.
References ResourceStorage\assureFolderReadPermission(), and Folder\getIdentifier().
createFile | ( | $fileName, | |
Folder | $targetFolderObject | ||
) |
Creates a new file
previously in ::func_newfile()
string | $fileName | The name of the file to be created |
Folder | $targetFolderObject | The target folder where the file should be created |
Exception\IllegalFileExtensionException | |
Exception\InsufficientFolderWritePermissionsException |
Definition at line 1693 of file ResourceStorage.php.
References ResourceStorage\assureFileAddPermissions(), ResourceStorage\emitPostFileCreateSignal(), Folder\getIdentifier(), ResourceFactory\getInstance(), and ResourceStorage\getUid().
createFolder | ( | $folderName, | |
Folder | $parentFolder = null |
||
) |
Creates a new folder.
previously in ::func_newfolder()
string | $folderName | The new folder name |
Folder | $parentFolder | (optional) the parent folder to create the new folder inside of. If not given, the root folder is used |
Exception\ExistingTargetFolderException | |
Exception\InsufficientFolderAccessPermissionsException | |
Exception\InsufficientFolderWritePermissionsException | |
\Exception |
Definition at line 2264 of file ResourceStorage.php.
References ResourceStorage\checkFolderActionPermission(), elseif, ResourceStorage\emitPostFolderAddSignal(), ResourceStorage\emitPreFolderAddSignal(), ResourceStorage\getDriver(), ResourceStorage\getFolder(), and ResourceStorage\getRootLevelFolder().
Referenced by ResourceStorage\getProcessingFolder().
deleteFile | ( | $fileObject | ) |
Previously in ::deleteFile()
$fileObject | FileInterface |
Exception\InsufficientFileAccessPermissionsException | |
Exception\FileOperationErrorException |
Definition at line 1709 of file ResourceStorage.php.
References ResourceStorage\assureFileDeletePermissions(), and ResourceStorage\emitPreFileDeleteSignal().
Referenced by ResourceStorage\deleteFolder().
deleteFolder | ( | $folderObject, | |
$deleteRecursively = false |
|||
) |
Previously in ::folder_delete()
Folder | $folderObject | |
bool | $deleteRecursively |
\RuntimeException | |
Exception\InsufficientFolderAccessPermissionsException | |
Exception\InsufficientUserPermissionsException | |
Exception\FileOperationErrorException | |
Exception\InvalidPathException |
Definition at line 2141 of file ResourceStorage.php.
References ResourceStorage\assureFolderDeletePermission(), ResourceStorage\deleteFile(), ResourceStorage\emitPostFolderDeleteSignal(), ResourceStorage\emitPreFolderDeleteSignal(), and ResourceStorage\getFilesInFolder().
dumpFileContents | ( | FileInterface | $file, |
$asDownload = false , |
|||
$alternativeFilename = null , |
|||
$overrideMimeType = null |
|||
) |
Outputs file Contents, clears output buffer first and sends headers accordingly.
FileInterface | $file | |
bool | $asDownload | If set Content-Disposition attachment is sent, inline otherwise |
string | $alternativeFilename | the filename for the download (if $asDownload is set) |
string | $overrideMimeType | If set this will be used as Content-Type header instead of the automatically detected mime type. |
Definition at line 1635 of file ResourceStorage.php.
References ResourceInterface\getIdentifier(), FileInterface\getMimeType(), ResourceInterface\getName(), and FileInterface\getSize().
|
protected |
Emits the file post-add signal.
FileInterface | $file | |
Folder | $targetFolder |
Definition at line 2421 of file ResourceStorage.php.
References ResourceStorage\getSignalSlotDispatcher().
Referenced by ResourceStorage\addFile().
|
protected |
Emits the file post-copy signal.
FileInterface | $file | |
Folder | $targetFolder |
Definition at line 2445 of file ResourceStorage.php.
References ResourceStorage\getSignalSlotDispatcher().
|
protected |
Emits the file post-create signal
string | $newFileIdentifier | |
Folder | $targetFolder |
Definition at line 2529 of file ResourceStorage.php.
References ResourceStorage\getSignalSlotDispatcher().
Referenced by ResourceStorage\createFile().
|
protected |
Emits the file post-deletion signal
FileInterface | $file |
Definition at line 2551 of file ResourceStorage.php.
References ResourceStorage\getSignalSlotDispatcher().
|
protected |
Emits the file post-move signal.
FileInterface | $file | |
Folder | $targetFolder | |
Folder | $originalFolder |
Definition at line 2470 of file ResourceStorage.php.
References ResourceStorage\getSignalSlotDispatcher().
Referenced by ResourceStorage\moveFile().
|
protected |
Emits the file post-rename signal.
FileInterface | $file | |
$targetFolder |
Definition at line 2494 of file ResourceStorage.php.
References ResourceStorage\getSignalSlotDispatcher().
Referenced by ResourceStorage\renameFile().
|
protected |
Emits the file post-replace signal
FileInterface | $file | |
string | $localFilePath |
Definition at line 2518 of file ResourceStorage.php.
References ResourceStorage\getSignalSlotDispatcher().
Referenced by ResourceStorage\replaceFile().
|
protected |
Emits the file post-set-contents signal
FileInterface | $file | |
mixed | $content |
Definition at line 2563 of file ResourceStorage.php.
References ResourceStorage\getSignalSlotDispatcher().
Referenced by ResourceStorage\setFileContents().
|
protected |
Emits the folder post-add signal.
Folder | $folder |
Definition at line 2586 of file ResourceStorage.php.
References ResourceStorage\getSignalSlotDispatcher().
Referenced by ResourceStorage\createFolder().
Emits the folder post-copy signal.
Definition at line 2612 of file ResourceStorage.php.
References ResourceStorage\getSignalSlotDispatcher().
Referenced by ResourceStorage\copyFolder().
|
protected |
Emits folder post-deletion signal..
Folder | $folder |
Definition at line 2685 of file ResourceStorage.php.
References ResourceStorage\getSignalSlotDispatcher().
Referenced by ResourceStorage\deleteFolder().
|
protected |
Emits the folder post-move signal.
Definition at line 2639 of file ResourceStorage.php.
References ResourceStorage\getSignalSlotDispatcher().
Referenced by ResourceStorage\moveFolder().
|
protected |
Emits the folder post-rename signal.
Folder | $folder | |
$newName |
Definition at line 2663 of file ResourceStorage.php.
References ResourceStorage\getSignalSlotDispatcher().
Referenced by ResourceStorage\renameFolder().
|
protected |
Emits file pre-add signal.
string | $targetFileName | |
Folder | $targetFolder | |
string | $sourceFilePath |
Definition at line 2408 of file ResourceStorage.php.
References ResourceStorage\getSignalSlotDispatcher().
Referenced by ResourceStorage\addFile().
|
protected |
Emits file pre-copy signal.
FileInterface | $file | |
Folder | $targetFolder |
Definition at line 2433 of file ResourceStorage.php.
References ResourceStorage\getSignalSlotDispatcher().
|
protected |
Emits the file pre-deletion signal.
FileInterface | $file |
Definition at line 2540 of file ResourceStorage.php.
References ResourceStorage\getSignalSlotDispatcher().
Referenced by ResourceStorage\deleteFile().
|
protected |
Emits the file pre-move signal.
FileInterface | $file | |
Folder | $targetFolder |
Definition at line 2457 of file ResourceStorage.php.
References ResourceStorage\getSignalSlotDispatcher().
Referenced by ResourceStorage\moveFile().
|
protected |
Emits the file pre-rename signal
FileInterface | $file | |
$targetFolder |
Definition at line 2482 of file ResourceStorage.php.
References ResourceStorage\getSignalSlotDispatcher().
Referenced by ResourceStorage\renameFile().
|
protected |
Emits the file pre-replace signal.
FileInterface | $file | |
$localFilePath |
Definition at line 2506 of file ResourceStorage.php.
References ResourceStorage\getSignalSlotDispatcher().
Referenced by ResourceStorage\replaceFile().
|
protected |
Emits the folder pre-add signal.
Folder | $targetFolder | |
string | $name |
Definition at line 2575 of file ResourceStorage.php.
References ResourceStorage\getSignalSlotDispatcher().
Referenced by ResourceStorage\createFolder().
Emits the folder pre-copy signal.
Definition at line 2599 of file ResourceStorage.php.
References ResourceStorage\getSignalSlotDispatcher().
Referenced by ResourceStorage\copyFolder().
|
protected |
Emits the folder pre-deletion signal.
Folder | $folder |
Definition at line 2674 of file ResourceStorage.php.
References ResourceStorage\getSignalSlotDispatcher().
Referenced by ResourceStorage\deleteFolder().
Emits the folder pre-move signal.
Definition at line 2625 of file ResourceStorage.php.
References ResourceStorage\getSignalSlotDispatcher().
Referenced by ResourceStorage\moveFolder().
|
protected |
Emits the folder pre-rename signal.
Folder | $folder | |
$newName |
Definition at line 2651 of file ResourceStorage.php.
References ResourceStorage\getSignalSlotDispatcher().
Referenced by ResourceStorage\renameFolder().
|
protected |
Emits file pre-processing signal when generating a public url for a file or folder.
ResourceInterface | $resourceObject | |
bool | $relativeToCurrentScript | |
array | $urlData |
Definition at line 2697 of file ResourceStorage.php.
References ResourceStorage\getSignalSlotDispatcher().
Referenced by ResourceStorage\getPublicUrl().
|
protected |
Emits sanitize fileName signal.
string | $fileName | |
Folder | $targetFolder |
Definition at line 2394 of file ResourceStorage.php.
References ResourceStorage\getSignalSlotDispatcher().
Referenced by ResourceStorage\sanitizeFileName().
getCapabilities | ( | ) |
Returns the capabilities of this storage.
Definition at line 276 of file ResourceStorage.php.
References ResourceStorage\$capabilities.
getConfiguration | ( | ) |
Gets the configuration.
Definition at line 190 of file ResourceStorage.php.
References ResourceStorage\$configuration.
getDefaultFolder | ( | ) |
Returns the default folder where new files are stored if no other folder is given.
Definition at line 2293 of file ResourceStorage.php.
References ResourceStorage\getFolder().
Referenced by ResourceStorage\addFile(), ResourceStorage\addUploadedFile(), and ResourceStorage\sanitizeFileName().
|
protected |
Returns the driver object belonging to this storage.
Definition at line 232 of file ResourceStorage.php.
References ResourceStorage\$driver.
Referenced by ResourceStorage\createFolder().
getDriverType | ( | ) |
Gets the driver Type configured for this storage.
Definition at line 2877 of file ResourceStorage.php.
getEvaluatePermissions | ( | ) |
Gets whether the permissions to access or write into this storage should be checked or not.
Definition at line 532 of file ResourceStorage.php.
References ResourceStorage\$evaluatePermissions.
getFile | ( | $identifier | ) |
Gets a file by identifier.
string | $identifier |
Definition at line 1348 of file ResourceStorage.php.
References ResourceStorage\getFileFactory(), and ResourceStorage\getUid().
getFileAndFolderNameFilters | ( | ) |
Returns the file and folder name filters used by this storage.
Definition at line 1407 of file ResourceStorage.php.
References ResourceStorage\$fileAndFolderNameFilters.
getFileContents | ( | $file | ) |
Get contents of a file object
FileInterface | $file |
Exception\InsufficientFileReadPermissionsException |
Definition at line 1619 of file ResourceStorage.php.
References ResourceStorage\assureFileReadPermission().
|
protected |
Definition at line 2781 of file ResourceStorage.php.
References GeneralUtility\makeInstance().
Referenced by ResourceStorage\getFile(), ResourceStorage\getFileInFolder(), and ResourceStorage\getFilesInFolder().
getFileForLocalProcessing | ( | FileInterface | $fileObject, |
$writable = true |
|||
) |
Copies a file from the storage for local processing.
FileInterface | $fileObject | |
bool | $writable |
Definition at line 1336 of file ResourceStorage.php.
References ResourceInterface\getIdentifier().
getFileIdentifiersInFolder | ( | $folderIdentifier, | |
$useFilters = true , |
|||
$recursive = false |
|||
) |
string | $folderIdentifier | |
bool | $useFilters | |
bool | $recursive |
Definition at line 1502 of file ResourceStorage.php.
|
protected |
Definition at line 2789 of file ResourceStorage.php.
References FileIndexRepository\getInstance().
Referenced by ResourceStorage\getFilesInFolder().
getFileInfo | ( | FileInterface | $fileObject | ) |
Gets information about a file.
FileInterface | $fileObject |
Definition at line 1364 of file ResourceStorage.php.
References ResourceStorage\getFileInfoByIdentifier(), and ResourceInterface\getIdentifier().
getFileInfoByIdentifier | ( | $identifier, | |
array | $propertiesToExtract = array() |
||
) |
Gets information about a file by its identifier.
string | $identifier | |
array | $propertiesToExtract |
Definition at line 1377 of file ResourceStorage.php.
Referenced by ResourceStorage\getFileInfo().
getFileInFolder | ( | $fileName, | |
Folder | $folder | ||
) |
Get file from folder
string | $fileName | |
Folder | $folder |
Definition at line 1447 of file ResourceStorage.php.
References ResourceStorage\getFileFactory(), Folder\getIdentifier(), and ResourceStorage\getUid().
Referenced by ResourceStorage\addUploadedFile().
getFileMounts | ( | ) |
Returns all file mounts that are registered with this storage.
Definition at line 468 of file ResourceStorage.php.
References ResourceStorage\$fileMounts.
|
protected |
Definition at line 2797 of file ResourceStorage.php.
References ResourceStorage\$fileProcessingService, and GeneralUtility\makeInstance().
Referenced by ResourceStorage\processFile().
getFilesInFolder | ( | Folder | $folder, |
$start = 0 , |
|||
$maxNumberOfItems = 0 , |
|||
$useFilters = true , |
|||
$recursive = false , |
|||
$sort = '' , |
|||
$sortRev = false |
|||
) |
Folder | $folder | |
int | $start | |
int | $maxNumberOfItems | |
bool | $useFilters | |
bool | $recursive | |
string | $sort | Property name used to sort the items. Among them may be: '' (empty, no sorting), name, fileext, size, tstamp and rw. If a driver does not support the given property, it should fall back to "name". |
bool | $sortRev | TRUE to indicate reverse sorting (last to first) |
Exception\InsufficientFolderAccessPermissionsException |
Definition at line 1468 of file ResourceStorage.php.
References ResourceStorage\assureFolderReadPermission(), ResourceStorage\getFileFactory(), ResourceStorage\getFileIndexRepository(), Folder\getIdentifier(), and ResourceStorage\getUid().
Referenced by ResourceStorage\deleteFolder().
getFolder | ( | $identifier, | |
$returnInaccessibleFolderObject = false |
|||
) |
string | $identifier | |
bool | $returnInaccessibleFolderObject |
\Exception | |
Exception\InsufficientFolderAccessPermissionsException |
Definition at line 2306 of file ResourceStorage.php.
References ResourceStorage\assureFolderReadPermission(), ResourceFactory\getInstance(), and GeneralUtility\makeInstance().
Referenced by ResourceStorage\copyFolder(), ResourceStorage\createFolder(), ResourceStorage\getDefaultFolder(), ResourceStorage\getFolderInFolder(), ResourceStorage\getFoldersInFolder(), ResourceStorage\moveFolder(), and ResourceStorage\renameFolder().
getFolderIdentifierFromFileIdentifier | ( | $fileIdentifier | ) |
getFolderIdentifiersInFolder | ( | $folderIdentifier, | |
$useFilters = true , |
|||
$recursive = false |
|||
) |
string | $folderIdentifier | |
bool | $useFilters | |
bool | $recursive |
Definition at line 1528 of file ResourceStorage.php.
getFolderInFolder | ( | $folderName, | |
Folder | $parentFolder, | ||
$returnInaccessibleFolderObject = false |
|||
) |
Returns the Identifier for a folder within a given folder.
string | $folderName | The name of the target folder |
Folder | $parentFolder | |
bool | $returnInaccessibleFolderObject |
\Exception | |
Exception\InsufficientFolderAccessPermissionsException |
Definition at line 2172 of file ResourceStorage.php.
References ResourceStorage\getFolder(), and Folder\getIdentifier().
getFoldersInFolder | ( | Folder | $folder, |
$start = 0 , |
|||
$maxNumberOfItems = 0 , |
|||
$useFilters = true , |
|||
$recursive = false , |
|||
$sort = '' , |
|||
$sortRev = false |
|||
) |
Folder | $folder | |
int | $start | |
int | $maxNumberOfItems | |
bool | $useFilters | |
bool | $recursive | |
string | $sort | Property name used to sort the items. Among them may be: '' (empty, no sorting), name, fileext, size, tstamp and rw. If a driver does not support the given property, it should fall back to "name". |
bool | $sortRev | TRUE to indicate reverse sorting (last to first) |
Definition at line 2192 of file ResourceStorage.php.
References ResourceStorage\$processingFolder, ResourceStorage\getFolder(), and Folder\getIdentifier().
|
protected |
Gets the Indexer.
Definition at line 2887 of file ResourceStorage.php.
References GeneralUtility\makeInstance().
Referenced by ResourceStorage\moveFile(), ResourceStorage\moveFolder(), ResourceStorage\renameFile(), ResourceStorage\renameFolder(), ResourceStorage\replaceFile(), and ResourceStorage\setFileContents().
getName | ( | ) |
|
protected |
Gets the ObjectManager.
Definition at line 2773 of file ResourceStorage.php.
References GeneralUtility\makeInstance().
Referenced by ResourceStorage\getSignalSlotDispatcher().
getProcessingFolder | ( | ) |
Getter function to return the folder where the files can be processed. Does not check for access rights here.
Definition at line 2841 of file ResourceStorage.php.
References ResourceStorage\$processingFolder, ResourceStorage\createFolder(), ResourceFactory\getInstance(), and GeneralUtility\makeInstance().
Referenced by ResourceStorage\updateProcessedFile().
getPublicUrl | ( | ResourceInterface | $resourceObject, |
$relativeToCurrentScript = false |
|||
) |
Returns a publicly accessible URL for a 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.
ResourceInterface | $resourceObject | The file or folder object |
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) |
Definition at line 1261 of file ResourceStorage.php.
References PathUtility\dirname(), elseif, ResourceStorage\emitPreGeneratePublicUrlSignal(), ResourceInterface\getIdentifier(), OnlineMediaHelperRegistry\getInstance(), PathUtility\getRelativePathTo(), ResourceStorage\hasCapability(), GeneralUtility\hmac(), ResourceStorage\isOnline(), and GeneralUtility\isValidUrl().
getRole | ( | FolderInterface | $folder | ) |
Gets the role of a folder.
FolderInterface | $folder | Folder object to get the role from |
Definition at line 2811 of file ResourceStorage.php.
References ResourceInterface\getIdentifier(), ResourceStorage\isProcessingFolder(), FolderInterface\ROLE_DEFAULT, FolderInterface\ROLE_MOUNT, FolderInterface\ROLE_PROCESSING, FolderInterface\ROLE_READONLY_MOUNT, and FolderInterface\ROLE_USER_MOUNT.
getRootLevelFolder | ( | $respectFileMounts = true | ) |
Returns the folders on the root level of the storage or the first mount point of this storage for this user if $respectFileMounts is set.
bool | $respectFileMounts |
Definition at line 2377 of file ResourceStorage.php.
References ResourceFactory\getInstance().
Referenced by ResourceStorage\createFolder(), and ResourceStorage\isWithinFileMountBoundaries().
|
protected |
Get the SignalSlot dispatcher.
Definition at line 2760 of file ResourceStorage.php.
References ResourceStorage\$signalSlotDispatcher, and ResourceStorage\getObjectManager().
Referenced by ResourceStorage\emitPostFileAddSignal(), ResourceStorage\emitPostFileCopySignal(), ResourceStorage\emitPostFileCreateSignal(), ResourceStorage\emitPostFileDeleteSignal(), ResourceStorage\emitPostFileMoveSignal(), ResourceStorage\emitPostFileRenameSignal(), ResourceStorage\emitPostFileReplaceSignal(), ResourceStorage\emitPostFileSetContentsSignal(), ResourceStorage\emitPostFolderAddSignal(), ResourceStorage\emitPostFolderCopySignal(), ResourceStorage\emitPostFolderDeleteSignal(), ResourceStorage\emitPostFolderMoveSignal(), ResourceStorage\emitPostFolderRenameSignal(), ResourceStorage\emitPreFileAddSignal(), ResourceStorage\emitPreFileCopySignal(), ResourceStorage\emitPreFileDeleteSignal(), ResourceStorage\emitPreFileMoveSignal(), ResourceStorage\emitPreFileRenameSignal(), ResourceStorage\emitPreFileReplaceSignal(), ResourceStorage\emitPreFolderAddSignal(), ResourceStorage\emitPreFolderCopySignal(), ResourceStorage\emitPreFolderDeleteSignal(), ResourceStorage\emitPreFolderMoveSignal(), ResourceStorage\emitPreFolderRenameSignal(), ResourceStorage\emitPreGeneratePublicUrlSignal(), and ResourceStorage\emitSanitizeFileNameSignal().
getStorageRecord | ( | ) |
Gets the storage record.
Definition at line 210 of file ResourceStorage.php.
References ResourceStorage\$storageRecord.
getUid | ( | ) |
Returns the UID of this storage.
Definition at line 252 of file ResourceStorage.php.
Referenced by ResourceStorage\addFile(), StoragePermissionsAspect\addFileMountsToStorage(), StoragePermissionsAspect\addUserPermissionsToStorage(), ResourceStorage\assureFileAddPermissions(), ResourceStorage\assureFileCopyPermissions(), ResourceStorage\assureFileMovePermissions(), ResourceStorage\assureFolderCopyPermissions(), ResourceStorage\assureFolderMovePermissions(), ResourceStorage\createFile(), ProcessedFileRepository\findByStorageAndIdentifier(), ResourceStorage\getFile(), ResourceStorage\getFileInFolder(), ResourceStorage\getFilesInFolder(), FolderTreeView\getShortHashNumberForStorage(), ResourceStorage\isOnline(), ResourceStorage\markAsPermanentlyOffline(), ResourceStorage\markAsTemporaryOffline(), ResourceStorage\moveFile(), ResourceStorage\moveFolder(), and AbstractFile\setStorage().
|
protected |
Returns the destination path/fileName of a unique fileName/foldername in that path. If $theFile exists in $theDest (directory) the file have numbers appended up to $this->maxNumber. Hereafter a unique string will be appended. This function is used by fx. TCEmain when files are attached to records and needs to be uniquely named in the uploads/* folders
Folder | $folder | |
string | $theFile | The input fileName to check |
bool | $dontCheckForUnique | If set the fileName is returned with the path prepended without checking whether it already existed! |
\RuntimeException |
Definition at line 2715 of file ResourceStorage.php.
References Folder\getIdentifier(), and PathUtility\pathinfo().
Referenced by ResourceStorage\addFile(), and ResourceStorage\moveFile().
|
protected |
Returns TRUE if this storage has the given capability.
int | $capability | A capability, as defined in a CAPABILITY_* constant |
Definition at line 287 of file ResourceStorage.php.
Referenced by ResourceStorage\getPublicUrl(), ResourceStorage\isBrowsable(), ResourceStorage\isPublic(), and ResourceStorage\isWritable().
hasChildren | ( | ) |
Tells whether there are children in this storage.
Definition at line 262 of file ResourceStorage.php.
hasFile | ( | $identifier | ) |
Returns TRUE if the specified file exists
string | $identifier |
Definition at line 1540 of file ResourceStorage.php.
References ResourceStorage\assureFolderReadPermission(), and ResourceStorage\isWithinProcessingFolder().
Referenced by ProcessedFileRepository\findByStorageAndIdentifier().
hasFileInFolder | ( | $fileName, | |
Folder | $folder | ||
) |
Checks if the queried file in the given folder exists
string | $fileName | |
Folder | $folder |
Definition at line 1605 of file ResourceStorage.php.
References ResourceStorage\assureFolderReadPermission(), and Folder\getIdentifier().
Referenced by ResourceStorage\addUploadedFile().
hasFolder | ( | $identifier | ) |
Returns TRUE if the specified folder exists.
string | $identifier |
Definition at line 2232 of file ResourceStorage.php.
References ResourceStorage\assureFolderReadPermission().
hasFolderInFolder | ( | $folderName, | |
Folder | $folder | ||
) |
Checks if the given file exists in the given folder
string | $folderName | |
Folder | $folder |
Definition at line 2245 of file ResourceStorage.php.
References ResourceStorage\assureFolderReadPermission(), and Folder\getIdentifier().
hashFile | ( | FileInterface | $fileObject, |
$hash | |||
) |
Creates a (cryptographic) hash for a file.
FileInterface | $fileObject | |
string | $hash |
Definition at line 1216 of file ResourceStorage.php.
References ResourceInterface\getIdentifier(), and ResourceStorage\hashFileByIdentifier().
hashFileByIdentifier | ( | $fileIdentifier, | |
$hash | |||
) |
Creates a (cryptographic) hash for a fileIdentifier.
string | $fileIdentifier | |
string | $hash |
Definition at line 1229 of file ResourceStorage.php.
Referenced by ResourceStorage\hashFile().
isBrowsable | ( | ) |
Returns TRUE if this storage is browsable by a (backend) user of TYPO3.
Definition at line 321 of file ResourceStorage.php.
References ResourceStorage\hasCapability(), and ResourceStorage\isOnline().
Referenced by ResourceStorage\checkFolderActionPermission().
isDefault | ( | ) |
Definition at line 2904 of file ResourceStorage.php.
References ResourceStorage\$isDefault.
Referenced by ResourceStorage\__construct(), and ResourceStorage\setDefault().
isOnline | ( | ) |
Returns TRUE if this storage is browsable by a (backend) user of TYPO3.
Definition at line 341 of file ResourceStorage.php.
References ResourceStorage\$isOnline, ResourceStorage\getUid(), and GeneralUtility\makeInstance().
Referenced by ResourceStorage\getPublicUrl(), ResourceStorage\isBrowsable(), ResourceStorage\markAsPermanentlyOffline(), and ResourceStorage\markAsTemporaryOffline().
isProcessingFolder | ( | Folder | $folder | ) |
Returns TRUE if folder that is in current storage is set as processing folder for one of the existing storages
Folder | $folder |
Definition at line 1586 of file ResourceStorage.php.
References ResourceStorage\$processingFolder, and Folder\getCombinedIdentifier().
Referenced by ResourceStorage\getRole().
isPublic | ( | ) |
Returns TRUE if this storage is publicly available. This is just a configuration option and does not mean that it really is public. OTOH a storage that is marked as not publicly available will trigger the file publishing mechanisms of TYPO3.
Definition at line 300 of file ResourceStorage.php.
References ResourceStorage\hasCapability().
isWithinFileMountBoundaries | ( | $subject, | |
$checkWriteAccess = false |
|||
) |
Checks if the given subject is within one of the registered user file mounts. If not, working with the file is not permitted for the user.
ResourceInterface | $subject | file or folder |
bool | $checkWriteAccess | If true, it is not only checked if the subject is within the file mount but also whether it isn't a read only file mount |
Definition at line 481 of file ResourceStorage.php.
References elseif, ResourceStorage\getRootLevelFolder(), and ResourceStorage\isWithinProcessingFolder().
Referenced by ResourceStorage\checkFileActionPermission(), and ResourceStorage\checkFolderActionPermission().
isWithinFolder | ( | Folder | $folder, |
ResourceInterface | $resource | ||
) |
Checks if a resource (file or folder) is within the given folder
Folder | $folder | |
ResourceInterface | $resource |
\InvalidArgumentException |
Definition at line 2358 of file ResourceStorage.php.
References ResourceInterface\getIdentifier(), Folder\getIdentifier(), ResourceInterface\getStorage(), and Folder\getStorage().
Referenced by ResourceStorage\copyFolder(), and ResourceStorage\moveFolder().
isWithinProcessingFolder | ( | $identifier | ) |
Returns TRUE if the specified file is in a folder that is set a processing for a storage
string | $identifier |
Definition at line 2338 of file ResourceStorage.php.
References ResourceStorage\$processingFolder.
Referenced by ResourceStorage\hasFile(), and ResourceStorage\isWithinFileMountBoundaries().
isWritable | ( | ) |
Returns TRUE if this storage is writable. This is determined by the driver and the storage configuration; user permissions are not taken into account.
Definition at line 311 of file ResourceStorage.php.
References ResourceStorage\hasCapability().
Referenced by ResourceStorage\checkFileActionPermission(), and ResourceStorage\checkFolderActionPermission().
markAsPermanentlyOffline | ( | ) |
Blows the "fuse" and marks the storage as offline.
Can only be modified by an admin.
Typically, this is only done if the configuration is wrong.
Definition at line 389 of file ResourceStorage.php.
References $GLOBALS, ResourceStorage\getUid(), and ResourceStorage\isOnline().
Referenced by ResourceStorage\__construct().
markAsTemporaryOffline | ( | ) |
Marks this storage as offline for the next 5 minutes.
Non-permanent: This typically happens for remote storages that are "flaky" and not available all the time.
Definition at line 407 of file ResourceStorage.php.
References ResourceStorage\getUid(), ResourceStorage\isOnline(), and GeneralUtility\makeInstance().
moveFile | ( | $file, | |
$targetFolder, | |||
$targetFileName = null , |
|||
$conflictMode = DuplicationBehavior::RENAME |
|||
) |
Moves a $file into a $targetFolder the target folder has to be part of this storage
previously in ::func_move()
FileInterface | $file | |
Folder | $targetFolder | |
string | $targetFileName | an optional destination fileName |
string | $conflictMode | a value of the enumeration |
Exception\ExistingTargetFileNameException | |
\RuntimeException |
Definition at line 1791 of file ResourceStorage.php.
References ResourceStorage\assureFileMovePermissions(), DuplicationBehavior\CANCEL, Enumeration\cast(), elseif, ResourceStorage\emitPostFileMoveSignal(), ResourceStorage\emitPreFileMoveSignal(), ResourceStorage\getIndexer(), ResourceStorage\getUid(), ResourceStorage\getUniqueName(), and DuplicationBehavior\RENAME.
moveFolder | ( | Folder | $folderToMove, |
Folder | $targetParentFolder, | ||
$newFolderName = null , |
|||
$conflictMode = DuplicationBehavior::RENAME |
|||
) |
Moves a folder. If you want to move a folder from this storage to another one, call this method on the target storage, otherwise you will get an exception.
Folder | $folderToMove | The folder to move. |
Folder | $targetParentFolder | The target parent folder |
string | $newFolderName | |
string | $conflictMode | a value of the enumeration |
\Exception|\TYPO3\CMS\Core\Exception | |
\InvalidArgumentException | |
InvalidTargetFolderException |
Definition at line 1978 of file ResourceStorage.php.
References ResourceStorage\assureFolderMovePermissions(), ResourceStorage\emitPostFolderMoveSignal(), ResourceStorage\emitPreFolderMoveSignal(), ResourceStorage\getFolder(), Folder\getIdentifier(), ResourceStorage\getIndexer(), Folder\getName(), Folder\getParentFolder(), Folder\getStorage(), ResourceStorage\getUid(), ResourceStorage\isWithinFolder(), and ResourceStorage\moveFolderBetweenStorages().
|
protected |
Moves the given folder from a different storage to the target folder in this storage.
\RuntimeException |
Definition at line 2026 of file ResourceStorage.php.
Referenced by ResourceStorage\moveFolder().
processFile | ( | FileInterface | $fileObject, |
$context, | |||
array | $configuration | ||
) |
Passes a file to the File Processing Services and returns the resulting ProcessedFile object.
FileInterface | $fileObject | The file object |
string | $context | |
array | $configuration |
\InvalidArgumentException |
Definition at line 1319 of file ResourceStorage.php.
References ResourceStorage\getFileProcessingService(), and ResourceInterface\getStorage().
renameFile | ( | $file, | |
$targetFileName | |||
) |
Previously in ::func_rename()
FileInterface | $file | |
string | $targetFileName |
Exception\InsufficientFileWritePermissionsException | |
Exception\InsufficientFileReadPermissionsException | |
Exception\InsufficientUserPermissionsException |
Definition at line 1845 of file ResourceStorage.php.
References ResourceStorage\assureFileRenamePermissions(), ResourceStorage\emitPostFileRenameSignal(), ResourceStorage\emitPreFileRenameSignal(), and ResourceStorage\getIndexer().
renameFolder | ( | $folderObject, | |
$newName | |||
) |
Previously in ::folder_move()
Folder | $folderObject | |
string | $newName |
\Exception | |
\InvalidArgumentException |
Definition at line 2097 of file ResourceStorage.php.
References ResourceStorage\checkFolderActionPermission(), ResourceStorage\emitPostFolderRenameSignal(), ResourceStorage\emitPreFolderRenameSignal(), ResourceStorage\getFolder(), and ResourceStorage\getIndexer().
replaceFile | ( | FileInterface | $file, |
$localFilePath | |||
) |
Replaces a file with a local file (e.g. a freshly uploaded file)
FileInterface | $file | |
string | $localFilePath |
Exception\IllegalFileExtensionException | |
\InvalidArgumentException |
Definition at line 1883 of file ResourceStorage.php.
References ResourceStorage\assureFileReplacePermissions(), ResourceStorage\autoExtractMetadataEnabled(), ResourceStorage\checkFileExtensionPermission(), ResourceStorage\emitPostFileReplaceSignal(), ResourceStorage\emitPreFileReplaceSignal(), ResourceInterface\getIdentifier(), ResourceStorage\getIndexer(), and GeneralUtility\makeInstance().
Referenced by ResourceStorage\addUploadedFile().
resetFileAndFolderNameFiltersToDefault | ( | ) |
Resets the file and folder name filters to the default values defined in the TYPO3 configuration.
Definition at line 1397 of file ResourceStorage.php.
References $GLOBALS.
Referenced by ResourceStorage\__construct().
sanitizeFileName | ( | $fileName, | |
Folder | $targetFolder = null |
||
) |
Clean a fileName from not allowed characters
string | $fileName | The name of the file to be add, If not set, the local file name is used |
Folder | $targetFolder | The target folder where the file should be added |
\InvalidArgumentException | |
Exception\ExistingTargetFileNameException |
Definition at line 1125 of file ResourceStorage.php.
References ResourceStorage\emitSanitizeFileNameSignal(), and ResourceStorage\getDefaultFolder().
Referenced by ResourceStorage\addFile().
setConfiguration | ( | array | $configuration | ) |
Sets the configuration.
array | $configuration |
Definition at line 200 of file ResourceStorage.php.
References ResourceStorage\$configuration.
setDefault | ( | $isDefault | ) |
bool | $isDefault |
Definition at line 2896 of file ResourceStorage.php.
References ResourceStorage\$isDefault, and ResourceStorage\isDefault().
setDriver | ( | Driver\DriverInterface | $driver | ) |
Sets the storage that belongs to this storage.
Driver\DriverInterface | $driver |
Definition at line 221 of file ResourceStorage.php.
References ResourceStorage\$driver.
setEvaluatePermissions | ( | $evaluatePermissions | ) |
Sets whether the permissions to access or write into this storage should be checked or not.
bool | $evaluatePermissions |
Definition at line 521 of file ResourceStorage.php.
References ResourceStorage\$evaluatePermissions.
Referenced by StoragePermissionsAspect\addUserPermissionsToStorage().
setFileAndFolderNameFilters | ( | array | $filters | ) |
setFileContents | ( | AbstractFile | $file, |
$contents | |||
) |
Set contents of a file object.
AbstractFile | $file | |
string | $contents |
\Exception|\RuntimeException | |
Exception\InsufficientFileWritePermissionsException | |
Exception\InsufficientUserPermissionsException |
Definition at line 1670 of file ResourceStorage.php.
References ResourceStorage\assureFileWritePermissions(), ResourceStorage\emitPostFileSetContentsSignal(), AbstractFile\getIdentifier(), and ResourceStorage\getIndexer().
setUserPermissions | ( | array | $userPermissions | ) |
Sets the user permissions of the storage.
array | $userPermissions |
Definition at line 543 of file ResourceStorage.php.
References ResourceStorage\$userPermissions.
Referenced by StoragePermissionsAspect\addUserPermissionsToStorage().
unsetFileAndFolderNameFilters | ( | ) |
Unsets the file and folder name filters, thus making this storage return unfiltered filelists.
Definition at line 1387 of file ResourceStorage.php.
updateProcessedFile | ( | $localFilePath, | |
ProcessedFile | $processedFile, | ||
Folder | $processingFolder = null |
||
) |
Updates a processed file with a new file from the local filesystem.
string | $localFilePath | |
ProcessedFile | $processedFile | |
Folder | $processingFolder |
\InvalidArgumentException |
Definition at line 1194 of file ResourceStorage.php.
References ResourceStorage\$processingFolder, ProcessedFile\getName(), ResourceStorage\getProcessingFolder(), and AbstractFile\setIdentifier().
usesCaseSensitiveIdentifiers | ( | ) |
Returns TRUE if the identifiers used by this storage are case-sensitive.
Definition at line 331 of file ResourceStorage.php.
|
protected |
Definition at line 115 of file ResourceStorage.php.
Referenced by ResourceStorage\getCapabilities().
|
protected |
Definition at line 77 of file ResourceStorage.php.
Referenced by ResourceStorage\getConfiguration(), and ResourceStorage\setConfiguration().
|
protected |
Definition at line 63 of file ResourceStorage.php.
Referenced by ResourceStorage\__construct(), ResourceStorage\getDriver(), and ResourceStorage\setDriver().
|
protected |
Definition at line 92 of file ResourceStorage.php.
Referenced by ResourceStorage\getEvaluatePermissions(), and ResourceStorage\setEvaluatePermissions().
|
protected |
Definition at line 151 of file ResourceStorage.php.
Referenced by ResourceStorage\getFileAndFolderNameFilters().
|
protected |
Definition at line 99 of file ResourceStorage.php.
Referenced by ResourceStorage\getFileMounts().
|
protected |
Definition at line 82 of file ResourceStorage.php.
Referenced by ResourceStorage\getFileProcessingService().
|
protected |
Definition at line 144 of file ResourceStorage.php.
Referenced by ResourceStorage\isDefault(), and ResourceStorage\setDefault().
|
protected |
Definition at line 139 of file ResourceStorage.php.
Referenced by ResourceStorage\isOnline().
|
protected |
Definition at line 125 of file ResourceStorage.php.
Referenced by ResourceStorage\getFoldersInFolder(), ResourceStorage\getProcessingFolder(), ResourceStorage\isProcessingFolder(), ResourceStorage\isWithinProcessingFolder(), and ResourceStorage\updateProcessedFile().
|
protected |
Definition at line 132 of file ResourceStorage.php.
|
protected |
Definition at line 120 of file ResourceStorage.php.
Referenced by ResourceStorage\getSignalSlotDispatcher().
|
protected |
Definition at line 70 of file ResourceStorage.php.
Referenced by ResourceStorage\__construct(), and ResourceStorage\getStorageRecord().
|
protected |
Definition at line 107 of file ResourceStorage.php.
Referenced by ResourceStorage\setUserPermissions().