function CacheInterface::set

8.0.x CacheInterface.php CacheInterface::set($cid, $data, $expire = DRUSH_CACHE_PERMANENT)
7.x CacheInterface.php CacheInterface::set($cid, $data, $expire = DRUSH_CACHE_PERMANENT)
master CacheInterface.php CacheInterface::set($cid, $data, $expire = DRUSH_CACHE_PERMANENT)

Store data in the persistent cache.

Parameters

string $cid: The cache ID of the data to store.

array $data: The data to store in the cache.

$expire: One of the following values:

  • DRUSH_CACHE_PERMANENT: Indicates that the item should never be removed unless explicitly told to using _drush_cache_clear_all() with a cache ID.
  • DRUSH_CACHE_TEMPORARY: Indicates that the item should be removed at the next general cache wipe.
  • A Unix timestamp: Indicates that the item should be kept at least until the given time, after which it behaves like CACHE_TEMPORARY.
1 method overrides CacheInterface::set()
FileCache::set in lib/Drush/Cache/FileCache.php
Store data in the persistent cache.

File

lib/Drush/Cache/CacheInterface.php, line 86
Definition of Drush\Cache\CacheInterface.

Namespace

Drush\Cache

Class

CacheInterface
Interface for cache implementations.

Code

function set($cid, $data, $expire = DRUSH_CACHE_PERMANENT);