Drupal 8  8.0.2
FileCache Class Reference
Inheritance diagram for FileCache:

Public Member Functions

 __construct ($prefix, $collection, $cache_backend_class=NULL, array $cache_backend_configuration=[])
 
 get ($filepath)
 
 getMultiple (array $filepaths)
 
 set ($filepath, $data)
 
 delete ($filepath)
 

Static Public Member Functions

static reset ()
 

Protected Attributes

 $prefix
 
 $collection
 
 $cache
 

Static Protected Attributes

static $cached = []
 

Detailed Description

Allows to cache data based on file modification dates.

Constructor & Destructor Documentation

__construct (   $prefix,
  $collection,
  $cache_backend_class = NULL,
array  $cache_backend_configuration = [] 
)

Constructs a FileCache object.

Parameters
string$prefixThe cache prefix.
string$collectionA collection identifier to ensure that the same files could be cached for different purposes without clashing.
string | null$cache_backend_class(optional) The class that should be used as cache backend.
array$cache_backend_configuration(optional) The configuration for the backend class.

References Drupal\cache().

Here is the call graph for this function:

Member Function Documentation

delete (   $filepath)

{Deletes data from the cache.

Parameters
string$filepathPath of the file that the cached data is based on.
}

Implements FileCacheInterface.

References Drupal\cache().

Here is the call graph for this function:

get (   $filepath)

{Gets data based on a filename.

Parameters
string$filepathPath of the file that the cached data is based on.
Returns
mixed|null The data that was persisted with set() or NULL if there is no data or the file has been modified.
}

Implements FileCacheInterface.

References FileCache\getMultiple().

Here is the call graph for this function:

getMultiple ( array  $filepaths)

{Gets data based on filenames.

Parameters
string[]$filepaths List of file paths used as cache identifiers.
Returns
array List of cached data keyed by the passed in file paths.
}

Implements FileCacheInterface.

References Drupal\cache().

Referenced by FileCache\get().

Here is the call graph for this function:

Here is the caller graph for this function:

static reset ( )
static

Resets the static cache.

Todo:
Replace this once https://www.drupal.org/node/2260187 is in.
set (   $filepath,
  $data 
)

{Stores data based on a filename.

Parameters
string$filepathPath of the file that the cached data is based on.
mixed$dataThe data that should be cached.
}

Implements FileCacheInterface.

References Drupal\cache().

Here is the call graph for this function:


The documentation for this class was generated from the following file: