AbstractHierarchicalFilesystemDriver extends AbstractDriver

AbstractYes

Class AbstractHierarchicalFilesystemDriver

Table of Contents

Properties

$capabilities  : int
The capabilities of this driver. See \TYPO3\CMS\Core\Resource\ResourceStorageInterface::::CAPABILITY_* constants for possible values. This value should be set in the constructor of derived classes.
$configuration  : array<string|int, mixed>
The configuration of this driver
$storageUid  : int
The storage uid the driver was instantiated for
$supportedHashAlgorithms  : array<string|int, mixed>
A list of all supported hash algorithms, written all lower case and without any dashes etc. (e.g. sha1 instead of SHA-1) Be sure to set this in inherited classes!

Methods

__construct()  : mixed
Creates this object.
getCapabilities()  : int
Returns the capabilities of this driver.
getParentFolderIdentifierOfIdentifier()  : mixed
Returns the identifier of the folder the file resides in
hasCapability()  : bool
Returns TRUE if this driver has the given capability.
hashIdentifier()  : string
Hashes a file identifier, taking the case sensitivity of the file system into account. This helps mitigating problems with case-insensitive databases.
isCaseSensitiveFileSystem()  : bool
Returns TRUE if this driver uses case-sensitive identifiers. NOTE: This is a configurable setting, but the setting does not change the way the underlying file system treats the identifiers; the setting should therefore always reflect the file system and not try to change its behaviour
sanitizeFileName()  : string
Basic implementation of the method that does directly return the file name as is.
setStorageUid()  : mixed
Sets the storage uid the driver belongs to
canonicalizeAndCheckFileIdentifier()  : string
Makes sure the Path given as parameter is valid
canonicalizeAndCheckFilePath()  : string
Makes sure the Path given as parameter is valid
canonicalizeAndCheckFolderIdentifier()  : string
Makes sure the Path given as parameter is valid
getTemporaryPathForFile()  : non-empty-string
Returns a temporary path for a given file, including the file extension.
isPathValid()  : bool
Wrapper for \TYPO3\CMS\Core\Utility\GeneralUtility::validPathStr()
isValidFilename()  : bool
Checks a fileName for validity. This could be overridden in concrete drivers if they have different file naming rules.

Properties

$capabilities

The capabilities of this driver. See \TYPO3\CMS\Core\Resource\ResourceStorageInterface::::CAPABILITY_* constants for possible values. This value should be set in the constructor of derived classes.

protected int $capabilities = 0

$configuration

The configuration of this driver

protected array<string|int, mixed> $configuration = []

$storageUid

The storage uid the driver was instantiated for

protected int $storageUid

$supportedHashAlgorithms

A list of all supported hash algorithms, written all lower case and without any dashes etc. (e.g. sha1 instead of SHA-1) Be sure to set this in inherited classes!

protected array<string|int, mixed> $supportedHashAlgorithms = []

Methods

__construct()

Creates this object.

public __construct([array<string|int, mixed> $configuration = [] ]) : mixed
Parameters
$configuration : array<string|int, mixed> = []

getParentFolderIdentifierOfIdentifier()

Returns the identifier of the folder the file resides in

public getParentFolderIdentifierOfIdentifier(string $fileIdentifier) : mixed
Parameters
$fileIdentifier : string

hasCapability()

Returns TRUE if this driver has the given capability.

public hasCapability(int $capability) : bool
Parameters
$capability : int

A capability, as defined in a CAPABILITY_* constant

Return values
bool

hashIdentifier()

Hashes a file identifier, taking the case sensitivity of the file system into account. This helps mitigating problems with case-insensitive databases.

public hashIdentifier(string $identifier) : string
Parameters
$identifier : string
Return values
string

isCaseSensitiveFileSystem()

Returns TRUE if this driver uses case-sensitive identifiers. NOTE: This is a configurable setting, but the setting does not change the way the underlying file system treats the identifiers; the setting should therefore always reflect the file system and not try to change its behaviour

public isCaseSensitiveFileSystem() : bool
Return values
bool

sanitizeFileName()

Basic implementation of the method that does directly return the file name as is.

public sanitizeFileName(string $fileName[, string $charset = '' ]) : string
Parameters
$fileName : string

Input string, typically the body of a fileName

$charset : string = ''

Charset of the a fileName (defaults to current charset; depending on context)

Return values
string

Output string with any characters not matching [.a-zA-Z0-9_-] is substituted by '_' and trailing dots removed

setStorageUid()

Sets the storage uid the driver belongs to

public setStorageUid(int $storageUid) : mixed
Parameters
$storageUid : int

canonicalizeAndCheckFileIdentifier()

Makes sure the Path given as parameter is valid

protected canonicalizeAndCheckFileIdentifier(string $fileIdentifier) : string
Parameters
$fileIdentifier : string

The file path (including the file name!)

Tags
throws
InvalidPathException
Return values
string

canonicalizeAndCheckFilePath()

Makes sure the Path given as parameter is valid

protected canonicalizeAndCheckFilePath(string $filePath) : string
Parameters
$filePath : string

The file path (including the file name!)

Tags
throws
InvalidPathException
Return values
string

canonicalizeAndCheckFolderIdentifier()

Makes sure the Path given as parameter is valid

protected canonicalizeAndCheckFolderIdentifier(string $folderPath) : string
Parameters
$folderPath : string

The file path (including the file name!)

Return values
string

getTemporaryPathForFile()

Returns a temporary path for a given file, including the file extension.

protected getTemporaryPathForFile(string $fileIdentifier) : non-empty-string
Parameters
$fileIdentifier : string
Return values
non-empty-string

isPathValid()

Wrapper for \TYPO3\CMS\Core\Utility\GeneralUtility::validPathStr()

protected isPathValid(string $theFile) : bool
Parameters
$theFile : string

Filepath to evaluate

Tags
see
GeneralUtility::validPathStr()
Return values
bool

TRUE if no '/', '..' or '' is in the $theFile

isValidFilename()

Checks a fileName for validity. This could be overridden in concrete drivers if they have different file naming rules.

protected isValidFilename(string $fileName) : bool
Parameters
$fileName : string
Return values
bool

TRUE if file name is valid


        
On this page

Search results