class Illuminate / Cache / FileStore
You are viewing an older version of the documentation. For the latest, please visit master documentation.

FileStore

Implements

Uses

Properties

protected

$files Filesystem

The Illuminate Filesystem instance.

Default: null
protected

$directory string

The file cache directory.

Default: null
protected

$filePermission int|null

Octal representation of the cache file permissions.

Default: null

Methods

public

__construct ( Filesystem $files , $directory , $filePermission ) : void

Create a new file cache store instance.

Parameters

  • $files Filesystem
  • $directory string
  • $filePermission int|null
public

get ( $key ) : mixed

Retrieve an item from the cache by key.

Parameters

  • $key string|array
public

put ( $key , $value , $seconds ) : bool

Store an item in the cache for a given number of seconds.

Parameters

  • $key string
  • $value mixed
  • $seconds int
public

add ( $key , $value , $seconds ) : bool

Store an item in the cache if the key doesn't exist.

Parameters

  • $key string
  • $value mixed
  • $seconds int
protected

ensureCacheDirectoryExists ( $path ) : void

Create the file cache directory if necessary.

Parameters

  • $path string
protected

ensurePermissionsAreCorrect ( $path ) : void

Ensure the created node has the correct permissions.

Parameters

  • $path string
public

increment ( $key , $value ) : int

Increment the value of an item in the cache.

Parameters

  • $key string
  • $value mixed
public

decrement ( $key , $value ) : int

Decrement the value of an item in the cache.

Parameters

  • $key string
  • $value mixed
public

forever ( $key , $value ) : bool

Store an item in the cache indefinitely.

Parameters

  • $key string
  • $value mixed
public

forget ( $key ) : bool

Remove an item from the cache.

Parameters

  • $key string
public

flush ( ) : bool

Remove all items from the cache.

protected

getPayload ( $key ) : array

Retrieve an item and expiry time from the cache by key.

Parameters

  • $key string
protected

emptyPayload ( ) : array

Get a default empty payload for the cache.

protected

path ( $key ) : string

Get the full path for the given cache key.

Parameters

  • $key string
protected

expiration ( $seconds ) : int

Get the expiration time based on the given seconds.

Parameters

  • $seconds int
public

getFilesystem ( ) : Filesystem

Get the Filesystem instance.

public

getDirectory ( ) : string

Get the working directory of the cache.

public

getPrefix ( ) : string

Get the cache key prefix.