‪TYPO3CMS  ‪main
TYPO3\CMS\Core\Resource\Driver\AbstractDriver Class Reference
Inheritance diagram for TYPO3\CMS\Core\Resource\Driver\AbstractDriver:
TYPO3\CMS\Core\Resource\Driver\AbstractHierarchicalFilesystemDriver TYPO3\CMS\Core\Tests\Unit\Resource\Driver\Fixtures\TestingDriver TYPO3\CMS\Core\Tests\Unit\Resource\Driver\Fixtures\TestingHierarchicalFilesystemDriver

Public Member Functions

 __construct (array $configuration=[])
 
 setStorageUid (int $storageUid)
 
 getCapabilities ()
 
 hasCapability (int $capability)
 
 hashIdentifier (string $identifier)
 
 isCaseSensitiveFileSystem ()
 

Protected Member Functions

 isValidFilename (string $fileName)
 
 getTemporaryPathForFile (string $fileIdentifier)
 
 canonicalizeAndCheckFilePath (string $filePath)
 
 canonicalizeAndCheckFileIdentifier (string $fileIdentifier)
 
 canonicalizeAndCheckFolderIdentifier (string $folderIdentifier)
 

Protected Attributes

Capabilities $capabilities
 
int $storageUid = null
 
array $supportedHashAlgorithms = []
 
array $configuration = []
 

Detailed Description

An abstract implementation of a storage driver.

Definition at line 27 of file AbstractDriver.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Core\Resource\Driver\AbstractDriver::__construct ( array  $configuration = [])

Creates this object.

Definition at line 64 of file AbstractDriver.php.

References TYPO3\CMS\Core\Resource\Driver\AbstractDriver\$configuration.

Member Function Documentation

◆ canonicalizeAndCheckFileIdentifier()

TYPO3\CMS\Core\Resource\Driver\AbstractDriver::canonicalizeAndCheckFileIdentifier ( string  $fileIdentifier)
abstractprotected

Makes sure the identifier given as parameter is valid

@phpstan-param non-empty-string $fileIdentifier The file Identifier @phpstan-return non-empty-string

Reimplemented in TYPO3\CMS\Core\Resource\Driver\AbstractHierarchicalFilesystemDriver, TYPO3\CMS\Core\Tests\Unit\Resource\Driver\Fixtures\TestingDriver, and TYPO3\CMS\Core\Tests\Unit\Resource\Driver\Fixtures\TestingHierarchicalFilesystemDriver.

Referenced by TYPO3\CMS\Core\Resource\Driver\AbstractDriver\hashIdentifier().

◆ canonicalizeAndCheckFilePath()

TYPO3\CMS\Core\Resource\Driver\AbstractDriver::canonicalizeAndCheckFilePath ( string  $filePath)
abstractprotected

Makes sure the path given as parameter is valid

@phpstan-param non-empty-string $filePath The file path (most times filePath) @phpstan-return non-empty-string

Reimplemented in TYPO3\CMS\Core\Resource\Driver\AbstractHierarchicalFilesystemDriver, and TYPO3\CMS\Core\Tests\Unit\Resource\Driver\Fixtures\TestingDriver.

◆ canonicalizeAndCheckFolderIdentifier()

TYPO3\CMS\Core\Resource\Driver\AbstractDriver::canonicalizeAndCheckFolderIdentifier ( string  $folderIdentifier)
abstractprotected

Makes sure the identifier given as parameter is valid

@phpstan-param non-empty-string $folderIdentifier The folder identifier @phpstan-return non-empty-string

Reimplemented in TYPO3\CMS\Core\Tests\Unit\Resource\Driver\Fixtures\TestingHierarchicalFilesystemDriver, TYPO3\CMS\Core\Resource\Driver\AbstractHierarchicalFilesystemDriver, and TYPO3\CMS\Core\Tests\Unit\Resource\Driver\Fixtures\TestingDriver.

◆ getCapabilities()

TYPO3\CMS\Core\Resource\Driver\AbstractDriver::getCapabilities ( )

Returns the capabilities of this driver.

Definition at line 95 of file AbstractDriver.php.

References TYPO3\CMS\Core\Resource\Driver\AbstractDriver\$capabilities.

Referenced by TYPO3\CMS\Core\Resource\Driver\AbstractDriver\hasCapability().

◆ getTemporaryPathForFile()

TYPO3\CMS\Core\Resource\Driver\AbstractDriver::getTemporaryPathForFile ( string  $fileIdentifier)
protected

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

@phpstan-param non-empty-string $fileIdentifier @phpstan-return non-empty-string

Definition at line 120 of file AbstractDriver.php.

References TYPO3\CMS\Core\Utility\PathUtility\pathinfo().

◆ hasCapability()

TYPO3\CMS\Core\Resource\Driver\AbstractDriver::hasCapability ( int  $capability)

Returns TRUE if this driver has the given capability.

@phpstan-param Capabilities::CAPABILITY_* $capability

Definition at line 105 of file AbstractDriver.php.

References TYPO3\CMS\Core\Resource\Driver\AbstractDriver\getCapabilities().

◆ hashIdentifier()

TYPO3\CMS\Core\Resource\Driver\AbstractDriver::hashIdentifier ( string  $identifier)

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

@phpstan-param non-empty-string $identifier @phpstan-return non-empty-string

Definition at line 133 of file AbstractDriver.php.

References TYPO3\CMS\Webhooks\Message\$identifier, and TYPO3\CMS\Core\Resource\Driver\AbstractDriver\canonicalizeAndCheckFileIdentifier().

◆ isCaseSensitiveFileSystem()

TYPO3\CMS\Core\Resource\Driver\AbstractDriver::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

Definition at line 146 of file AbstractDriver.php.

Referenced by TYPO3\CMS\Core\Resource\Driver\AbstractHierarchicalFilesystemDriver\canonicalizeAndCheckFileIdentifier().

◆ isValidFilename()

TYPO3\CMS\Core\Resource\Driver\AbstractDriver::isValidFilename ( string  $fileName)
protected

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

Definition at line 73 of file AbstractDriver.php.

◆ setStorageUid()

TYPO3\CMS\Core\Resource\Driver\AbstractDriver::setStorageUid ( int  $storageUid)

Sets the storage uid the driver belongs to

Definition at line 87 of file AbstractDriver.php.

References TYPO3\CMS\Core\Resource\Driver\AbstractDriver\$storageUid.

Member Data Documentation

◆ $capabilities

Capabilities TYPO3\CMS\Core\Resource\Driver\AbstractDriver::$capabilities
protected

The capabilities of this driver. This value should be set in the constructor of derived classes.

Definition at line 35 of file AbstractDriver.php.

Referenced by TYPO3\CMS\Core\Resource\Driver\AbstractDriver\getCapabilities().

◆ $configuration

array TYPO3\CMS\Core\Resource\Driver\AbstractDriver::$configuration = []
protected

The configuration of this driver

Definition at line 59 of file AbstractDriver.php.

Referenced by TYPO3\CMS\Core\Resource\Driver\AbstractDriver\__construct().

◆ $storageUid

int TYPO3\CMS\Core\Resource\Driver\AbstractDriver::$storageUid = null
protected

The storage uid the driver was instantiated for

Definition at line 40 of file AbstractDriver.php.

Referenced by TYPO3\CMS\Core\Resource\Driver\AbstractDriver\setStorageUid().

◆ $supportedHashAlgorithms

array TYPO3\CMS\Core\Resource\Driver\AbstractDriver::$supportedHashAlgorithms = []
protected

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!

@phpstan-var list<string>

Todo:
‪: Remove this from this class. Properties of abstract classes MUST NOT be api. If all drivers need to implement this, consider creating a new method stub in the DriverInterface or consider creating a new SupportedHashAlgorithmsAwareInterface that demands implementations to provide said information. Inside this abstract class, this property is useless, however.

Definition at line 54 of file AbstractDriver.php.