Properties

$autosave

$autosave : boolean

Type

boolean

$cache

$cache : array

Type

array

$complete

$complete : array

Type

array

$file

$file : string

Type

string — the file to cache to

$expire

$expire : integer|null

Type

integer|null — seconds until cache expiration

Methods

__destruct()

__destruct() 

Destructor.

getAutosave()

getAutosave() : boolean

Get the autosave setting.

Returns

boolean —

autosave

setAutosave()

setAutosave(boolean  $autosave) 

Get the autosave setting.

Parameters

boolean $autosave

storeContents()

storeContents(string  $directory, array  $contents, boolean  $recursive = false) : array

Store the contents listing.

Parameters

string $directory
array $contents
boolean $recursive

Returns

array —

contents listing

updateObject()

updateObject(string  $path, array  $object, boolean  $autosave = false) 

Update the metadata for an object.

Parameters

string $path

object path

array $object

object metadata

boolean $autosave

whether to trigger the autosave routine

storeMiss()

storeMiss(string  $path) 

Store object hit miss.

Parameters

string $path

listContents()

listContents(string  $dirname = '', boolean  $recursive = false) : array

Get the contents listing.

Parameters

string $dirname
boolean $recursive

Returns

array —

contents listing

has()

has(  $path) 

{@inheritdoc}

Parameters

$path

read()

read(  $path) 

{@inheritdoc}

Parameters

$path

readStream()

readStream(  $path) 

{@inheritdoc}

Parameters

$path

rename()

rename(string  $path, string  $newpath) 

Rename a file.

Parameters

string $path
string $newpath

copy()

copy(string  $path, string  $newpath) 

Copy a file.

Parameters

string $path
string $newpath

delete()

delete(string  $path) 

Delete an object from cache.

Parameters

string $path

object path

deleteDir()

deleteDir(string  $dirname) 

Delete all objects from from a directory.

Parameters

string $dirname

directory path

getMimetype()

getMimetype(  $path) 

{@inheritdoc}

Parameters

$path

getSize()

getSize(  $path) 

{@inheritdoc}

Parameters

$path

getTimestamp()

getTimestamp(  $path) 

{@inheritdoc}

Parameters

$path

getVisibility()

getVisibility(  $path) 

{@inheritdoc}

Parameters

$path

getMetadata()

getMetadata(  $path) 

{@inheritdoc}

Parameters

$path

isComplete()

isComplete(string  $dirname, boolean  $recursive) : boolean

Check whether the directory listing of a given directory is complete.

Parameters

string $dirname
boolean $recursive

Returns

boolean

setComplete()

setComplete(string  $dirname, boolean  $recursive) 

Set a directory to completely listed.

Parameters

string $dirname
boolean $recursive

cleanContents()

cleanContents(array  $contents) : array

Filter the contents from a listing.

Parameters

array $contents

object listing

Returns

array —

filtered contents

flush()

flush() 

Flush the cache.

autosave()

autosave() 

Autosave trigger.

getForStorage()

getForStorage() : string

Retrieve serialized cache data.

Returns

string —

serialized data

setFromStorage()

setFromStorage(string  $json) 

Load from serialized cache data.

Parameters

string $json

ensureParentDirectories()

ensureParentDirectories(string  $path) 

Ensure parent directories of an object.

Parameters

string $path

object path

__construct()

__construct(\League\Flysystem\AdapterInterface  $adapter, string  $file, integer|null  $expire = null) 

Constructor.

Parameters

\League\Flysystem\AdapterInterface $adapter

adapter

string $file

the file to cache to

integer|null $expire

seconds until cache expiration

load()

load() 

{@inheritdoc}

save()

save() 

{@inheritdoc}

pathIsInDirectory()

pathIsInDirectory(string  $directory, string  $path) : boolean

Determines if the path is inside the directory.

Parameters

string $directory
string $path

Returns

boolean

setExpire()

setExpire(integer  $expire) 

Set the expiration time in seconds.

Parameters

integer $expire

relative expiration time

getTime()

getTime(integer  $time) : integer

Get expiration time in seconds.

Parameters

integer $time

relative expiration time

Returns

integer —

actual expiration time