\app\framework\Component\Storage\DriverDriverInterface

Interface DriverInterface

Summary

Methods
Constants
getContents()
setContents()
keyExists()
getKeys()
getTimeModified()
deleteKey()
renameKey()
getRecentKey()
getURL()
createDateFolderStructure()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

getContents()

getContents(string  $key) : string|boolean

Reads the contents of the file

Parameters

string $key

Returns

string|boolean —

if cannot read content

setContents()

setContents(  $key,   $contents, boolean  $append = false) : boolean|integer

Writes the given File

Parameters

$key
$contents
boolean $append

Returns

boolean|integer —

The number of bytes that were written into the file

keyExists()

keyExists(string  $key) : boolean

Checks whether the file exists

Parameters

string $key

Returns

boolean

getKeys()

getKeys(string  $key = '', boolean|integer  $recursive = false) : array

Returns an array of all keys (files and directories)

For storages that do not support directories, both parameters are irrelevant.

Parameters

string $key

(Optional) Key of a directory to get keys from. If not set - keys will be read from the storage root.

boolean|integer $recursive

(Optional) Read all items recursively. Pass integer value to specify recursion depth.

Returns

array

getTimeModified()

getTimeModified(string  $key) : integer|boolean

Returns the last modified time

Parameters

string $key

Returns

integer|boolean —

A UNIX like timestamp or false

deleteKey()

deleteKey(string  $key) : boolean

Deletes the file

Parameters

string $key

Returns

boolean

renameKey()

renameKey(string  $sourceKey, string  $targetKey) : boolean

Renames a file

Parameters

string $sourceKey
string $targetKey

Throws

\app\framework\Component\Storage\StorageException

Returns

boolean

getRecentKey()

getRecentKey() : string|null

Returns most recent file key that was used by a storage

Returns

string|null

getURL()

getURL(  $key) : mixed

Returns public file URL

Parameters

$key

Returns

mixed

createDateFolderStructure()

createDateFolderStructure() : boolean

Does this storage create a date folder structure?

Returns

boolean