function drush_cache_set

8.0.x cache.inc drush_cache_set($cid, $data, $bin = 'default', $expire = DRUSH_CACHE_PERMANENT)
6.x cache.inc drush_cache_set($cid, $data, $bin = 'default', $expire = DRUSH_CACHE_PERMANENT)
7.x cache.inc drush_cache_set($cid, $data, $bin = 'default', $expire = DRUSH_CACHE_PERMANENT)
4.x cache.drush.inc drush_cache_set($cid = NULL, $data = '', $bin = NULL, $expire = CACHE_PERMANENT)
5.x cache.inc drush_cache_set($cid, $data, $bin = 'default', $expire = DRUSH_CACHE_PERMANENT)
master cache.inc drush_cache_set($cid, $data, $bin = 'default', $expire = DRUSH_CACHE_PERMANENT)

Store data in the persistent cache.

Parameters

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

$data: The data to store in the cache.

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

$expire: One of the following values:

  • DRUSH_CACHE_PERMANENT: Indicates that the item should never be removed unless explicitly told to using 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 DRUSH_CACHE_TEMPORARY.
2 calls to drush_cache_set()
drush_complete_cache_set in includes/complete.inc
Stores caches for completions.
_drush_add_commandfiles in includes/command.inc

File

includes/cache.inc, line 106
Drush cache API

Code

function drush_cache_set($cid, $data, $bin = 'default', $expire = DRUSH_CACHE_PERMANENT) {
  $ret = _drush_cache_get_object($bin)->set($cid, $data, $expire);
  if ($ret) {
    drush_log(dt("Cache SET cid: !cid", array('!cid' => $cid)), 'debug');
  }
  return $ret;
}