function drush_cache_command_get

8.0.x cache.drush.inc drush_cache_command_get($cid = NULL, $bin = NULL)
6.x cache.drush.inc drush_cache_command_get($cid = NULL, $bin = NULL)
7.x cache.drush.inc drush_cache_command_get($cid = NULL, $bin = NULL)
5.x cache.drush.inc drush_cache_command_get($cid = NULL, $bin = NULL)
master cache.drush.inc drush_cache_command_get($cid = NULL, $bin = NULL)

Print an object returned from the cache.

Parameters

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

$bin: Optional parameter to specify a specific bin to fetch from.

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

File

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

Code

function drush_cache_command_get($cid = NULL, $bin = NULL) {
  if (!$cid) {
    return drush_set_error('DRUSH_CACHE_NOT_SPECIFIED', dt('You must specify a cache id to fetch.'));
  }

  if (!$bin) {
    $bin = 'cache';
  }

  $result = cache_get($cid, $bin);
  if (empty($result)) {
    return drush_set_error('DRUSH_CACHE_OBJECT_NOT_FOUND', dt('The !cid object in the !bin cache bin was not found.', array('!cid' => $cid, '!bin' => $bin)));
  }
  return $result;
}