function drush_cache_command_set

8.0.x cache.drush.inc drush_cache_command_set($cid = NULL, $data = '', $bin = NULL, $expire = NULL, $tags = array())
6.x cache.drush.inc drush_cache_command_set($cid = NULL, $data = '', $bin = NULL, $expire = CACHE_PERMANENT)
7.x cache.drush.inc drush_cache_command_set($cid = NULL, $data = '', $bin = NULL, $expire = NULL, $tags = array())
5.x cache.drush.inc drush_cache_command_set($cid = NULL, $data = '', $bin = NULL, $expire = CACHE_PERMANENT)
master cache.drush.inc drush_cache_command_set($cid = NULL, $data = '', $bin = NULL, $expire = NULL, $tags = array())

Set an object in the cache.

Parameters

$cid: The cache ID of the object to fetch.

$data: The data to save to the cache, or '-' to read from STDIN.

$bin: A specific bin to fetch from. If not specified, the default bin is used.

$expire: The expiry timestamp for the cached object.

$tags: Cache tags for the cached object.

1 string reference to 'drush_cache_command_set'
cache_drush_command in commands/core/cache.drush.inc
Implementation of hook_drush_command().

File

commands/core/cache.drush.inc, line 185

Code

function drush_cache_command_set($cid = NULL, $data = '', $bin = NULL, $expire = NULL, $tags = array()) {
  // In addition to prepare, this also validates. Can't easily be in own validate callback as
  // reading once from STDIN empties it.
  $data = drush_cache_set_prepare_data($data);
  if ($data === FALSE && drush_get_error()) {
    // An error was logged above.
    return;
  }

  drush_include_engine('drupal', 'cache');
  return drush_op('_drush_cache_command_set', $cid, $data, $bin, $expire, $tags);
}