class Illuminate / Cache / FileStore
You're browsing the documentation for an upcoming version of Laravel. The documentation and features of this release are subject to change.

FileStore

Implements

Uses

Properties

protected

$files Filesystem

The Illuminate Filesystem instance.

Default: null
protected

$directory string

The file cache directory.

Default: null
protected

$lockDirectory string|null

The file cache lock 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

lock ( $name , $seconds , $owner ) : Lock

Get a lock instance.

Parameters

  • $name string
  • $seconds int
  • $owner string|null
public

restoreLock ( $name , $owner ) : Lock

Restore a lock instance using the owner identifier.

Parameters

  • $name string
  • $owner string
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.

public

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

setLockDirectory ( $lockDirectory ) : $this

Set the cache directory where locks should be stored.

Parameters

  • $lockDirectory string|null
public

getPrefix ( ) : string

Get the cache key prefix.