AbstractDriver implements DriverInterface
An abstract implementation of a storage driver.
Table of Contents
Interfaces
- DriverInterface
- An interface Drivers have to implement to fulfil the needs of the FAL API.
Properties
- $capabilities : Capabilities
- The capabilities of this driver. This value should be set in the constructor of derived classes.
- $configuration : array<string|int, mixed>
- The configuration of this driver
- $storageUid : int|null
- 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() : Capabilities
- Returns the capabilities of this driver.
- hasCapability() : bool
- Returns TRUE if this driver has the given capability.
- hashIdentifier() : non-empty-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
- setStorageUid() : void
- Sets the storage uid the driver belongs to
- canonicalizeAndCheckFileIdentifier() : string
- Makes sure the identifier given as parameter is valid
- canonicalizeAndCheckFilePath() : string
- Makes sure the path given as parameter is valid
- canonicalizeAndCheckFolderIdentifier() : string
- Makes sure the identifier given as parameter is valid
- getTemporaryPathForFile() : string
- Returns a temporary path for a given file, including the file extension.
- 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. This value should be set in the constructor of derived classes.
protected
Capabilities
$capabilities
$configuration
The configuration of this driver
protected
array<string|int, mixed>
$configuration
= []
$storageUid
The storage uid the driver was instantiated for
protected
int|null
$storageUid
= null
$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
= []
Tags
Methods
__construct()
Creates this object.
public
__construct([array<string|int, mixed> $configuration = [] ]) : mixed
Parameters
- $configuration : array<string|int, mixed> = []
getCapabilities()
Returns the capabilities of this driver.
public
getCapabilities() : Capabilities
Return values
CapabilitieshasCapability()
Returns TRUE if this driver has the given capability.
public
hasCapability(int $capability) : bool
Parameters
- $capability : int
Tags
Return values
boolhashIdentifier()
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) : non-empty-string
Parameters
- $identifier : string
Tags
Return values
non-empty-stringisCaseSensitiveFileSystem()
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
boolsetStorageUid()
Sets the storage uid the driver belongs to
public
setStorageUid(int $storageUid) : void
Parameters
- $storageUid : int
canonicalizeAndCheckFileIdentifier()
Makes sure the identifier given as parameter is valid
protected
abstract canonicalizeAndCheckFileIdentifier(string $fileIdentifier) : string
Parameters
- $fileIdentifier : string
Tags
Return values
stringcanonicalizeAndCheckFilePath()
Makes sure the path given as parameter is valid
protected
abstract canonicalizeAndCheckFilePath(string $filePath) : string
Parameters
- $filePath : string
Tags
Return values
stringcanonicalizeAndCheckFolderIdentifier()
Makes sure the identifier given as parameter is valid
protected
abstract canonicalizeAndCheckFolderIdentifier(string $folderIdentifier) : string
Parameters
- $folderIdentifier : string
Tags
Return values
stringgetTemporaryPathForFile()
Returns a temporary path for a given file, including the file extension.
protected
getTemporaryPathForFile(string $fileIdentifier) : string
Parameters
- $fileIdentifier : string
Tags
Return values
stringisValidFilename()
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