TYPO3  7.6
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
AbstractDriver Class Reference
Inheritance diagram for AbstractDriver:
DriverInterface AbstractHierarchicalFilesystemDriver LocalDriver

Public Member Functions

 __construct (array $configuration=array())
 
 setStorageUid ($storageUid)
 
 getCapabilities ()
 
 hasCapability ($capability)
 
 hashIdentifier ($identifier)
 
 sanitizeFileName ($fileName, $charset= '')
 
 isCaseSensitiveFileSystem ()
 
- Public Member Functions inherited from DriverInterface
 processConfiguration ()
 
 initialize ()
 
 mergeConfigurationCapabilities ($capabilities)
 
 getRootLevelFolder ()
 
 getDefaultFolder ()
 
 getParentFolderIdentifierOfIdentifier ($fileIdentifier)
 
 getPublicUrl ($identifier)
 
 createFolder ($newFolderName, $parentFolderIdentifier= '', $recursive=false)
 
 renameFolder ($folderIdentifier, $newName)
 
 deleteFolder ($folderIdentifier, $deleteRecursively=false)
 
 fileExists ($fileIdentifier)
 
 folderExists ($folderIdentifier)
 
 isFolderEmpty ($folderIdentifier)
 
 addFile ($localFilePath, $targetFolderIdentifier, $newFileName= '', $removeOriginal=true)
 
 createFile ($fileName, $parentFolderIdentifier)
 
 copyFileWithinStorage ($fileIdentifier, $targetFolderIdentifier, $fileName)
 
 renameFile ($fileIdentifier, $newName)
 
 replaceFile ($fileIdentifier, $localFilePath)
 
 deleteFile ($fileIdentifier)
 
 hash ($fileIdentifier, $hashAlgorithm)
 
 moveFileWithinStorage ($fileIdentifier, $targetFolderIdentifier, $newFileName)
 
 moveFolderWithinStorage ($sourceFolderIdentifier, $targetFolderIdentifier, $newFolderName)
 
 copyFolderWithinStorage ($sourceFolderIdentifier, $targetFolderIdentifier, $newFolderName)
 
 getFileContents ($fileIdentifier)
 
 setFileContents ($fileIdentifier, $contents)
 
 fileExistsInFolder ($fileName, $folderIdentifier)
 
 folderExistsInFolder ($folderName, $folderIdentifier)
 
 getFileForLocalProcessing ($fileIdentifier, $writable=true)
 
 getPermissions ($identifier)
 
 dumpFileContents ($identifier)
 
 isWithin ($folderIdentifier, $identifier)
 
 getFileInfoByIdentifier ($fileIdentifier, array $propertiesToExtract=array())
 
 getFolderInfoByIdentifier ($folderIdentifier)
 
 getFileInFolder ($fileName, $folderIdentifier)
 
 getFilesInFolder ($folderIdentifier, $start=0, $numberOfItems=0, $recursive=false, array $filenameFilterCallbacks=array(), $sort= '', $sortRev=false)
 
 getFolderInFolder ($folderName, $folderIdentifier)
 
 getFoldersInFolder ($folderIdentifier, $start=0, $numberOfItems=0, $recursive=false, array $folderNameFilterCallbacks=array(), $sort= '', $sortRev=false)
 
 countFilesInFolder ($folderIdentifier, $recursive=false, array $filenameFilterCallbacks=array())
 
 countFoldersInFolder ($folderIdentifier, $recursive=false, array $folderNameFilterCallbacks=array())
 

Protected Member Functions

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

Protected Attributes

 $capabilities = 0
 
 $storageUid
 
 $supportedHashAlgorithms = array()
 
 $configuration = array()
 

Detailed Description

An abstract implementation of a storage driver.

Definition at line 23 of file AbstractDriver.php.

Constructor & Destructor Documentation

__construct ( array  $configuration = array())

Creates this object.

Parameters
array$configuration

Definition at line 65 of file AbstractDriver.php.

References AbstractDriver\$configuration.

Member Function Documentation

canonicalizeAndCheckFileIdentifier (   $fileIdentifier)
abstractprotected

Makes sure the identifier given as parameter is valid

Parameters
string$fileIdentifierThe file Identifier
Returns
string
Exceptions
\TYPO3\CMS\Core\Resource\Exception\InvalidPathException

Referenced by AbstractDriver\hashIdentifier().

canonicalizeAndCheckFilePath (   $filePath)
abstractprotected

Makes sure the path given as parameter is valid

Parameters
string$filePathThe file path (most times filePath)
Returns
string
canonicalizeAndCheckFolderIdentifier (   $folderIdentifier)
abstractprotected

Makes sure the identifier given as parameter is valid

Parameters
string$folderIdentifierThe folder identifier
Returns
string
getCapabilities ( )

Returns the capabilities of this driver.

Returns
int
See Also
Storage::CAPABILITY_* constants

Implements DriverInterface.

Definition at line 105 of file AbstractDriver.php.

References AbstractDriver\$capabilities.

getTemporaryPathForFile (   $fileIdentifier)
protected

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

Parameters
string$fileIdentifier
Returns
string

Definition at line 131 of file AbstractDriver.php.

References PathUtility\pathinfo().

Referenced by LocalDriver\copyFileToTemporaryPath().

hasCapability (   $capability)

Returns TRUE if this driver has the given capability.

Parameters
int$capabilityA capability, as defined in a CAPABILITY_* constant
Returns
bool

Implements DriverInterface.

Definition at line 116 of file AbstractDriver.php.

Referenced by LocalDriver\determineBaseUrl().

hashIdentifier (   $identifier)

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

Parameters
string$identifier
Returns
string

Implements DriverInterface.

Definition at line 144 of file AbstractDriver.php.

References AbstractDriver\canonicalizeAndCheckFileIdentifier().

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

Returns
bool

Implements DriverInterface.

Definition at line 172 of file AbstractDriver.php.

Referenced by AbstractHierarchicalFilesystemDriver\canonicalizeAndCheckFileIdentifier().

isValidFilename (   $fileName)
protected

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

Parameters
string$fileName
Returns
bool TRUE if file name is valid

Definition at line 77 of file AbstractDriver.php.

Referenced by LocalDriver\createFile().

sanitizeFileName (   $fileName,
  $charset = '' 
)

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

Parameters
string$fileNameInput string, typically the body of a fileName
string$charsetCharset of the a fileName (defaults to current charset; depending on context)
Returns
string Output string with any characters not matching [.a-zA-Z0-9_-] is substituted by '_' and trailing dots removed

Implements DriverInterface.

Definition at line 158 of file AbstractDriver.php.

setStorageUid (   $storageUid)

Sets the storage uid the driver belongs to

Parameters
int$storageUid
Returns
void

Implements DriverInterface.

Definition at line 94 of file AbstractDriver.php.

References AbstractDriver\$storageUid.

Member Data Documentation

$capabilities = 0
protected
$configuration = array()
protected

Definition at line 58 of file AbstractDriver.php.

Referenced by AbstractDriver\__construct(), and LocalDriver\__construct().

$storageUid
protected

Definition at line 42 of file AbstractDriver.php.

Referenced by AbstractDriver\setStorageUid().

$supportedHashAlgorithms = array()
protected

Definition at line 51 of file AbstractDriver.php.