\Visionline\Crm\WebApiFileCache

Implements a cache using files.

Files are locked to ensure, that concurrent calls to get and put do not corrupt the cache.

Summary

Methods
Properties
Constants
__construct()
clear()
get()
put()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
getFilename()
$directory
N/A

Properties

$directory

$directory : string

The directory in which to store the cache's files.

Type

string

Methods

__construct()

__construct(string  $directory) 

Create a new file cache

Parameters

string $directory

The directory in which to store the cache's files.

Throws

\InvalidArgumentException

If the paramter directory is not set, does not denote a directory, or the specified directory is not writeable.

clear()

clear(integer  $ttl) 

Clears entries by deleting cache files.

Parameters

integer $ttl

Time-to-live of a file in seconds (based on its modification time) that, if not reached, keeps it from being deleted by this method

Warning: count(): Parameter must be an array or an object that implements Countable in phar://E:/source/CRM-VISIONLINE/3.4.2/Source/Website/build/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1376 Warning: count(): Parameter must be an array or an object that implements Countable in phar://E:/source/CRM-VISIONLINE/3.4.2/Source/Website/build/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1376

get()

get(string  $key) : mixed

Returns the data stored under the specified key.

Parameters

string $key

The key under which the data is stored

Throws

\Exception

if an error occurs

Returns

mixed —

The data stored under the specified key.

put()

put(string  $key, mixed  $data) 

Stores the data under the specified key

Parameters

string $key

The key under which to store the data

mixed $data

The data to store

Throws

\Exception

if an error occurs

getFilename()

getFilename(string  $key) : string

Computes the filename for a specified key.

Parameters

string $key

The key

Warning: count(): Parameter must be an array or an object that implements Countable in phar://E:/source/CRM-VISIONLINE/3.4.2/Source/Website/build/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1376 Warning: count(): Parameter must be an array or an object that implements Countable in phar://E:/source/CRM-VISIONLINE/3.4.2/Source/Website/build/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1376

Returns

string —

The filename