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 126

Code

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

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

  $result = cache_get($cid, $bin);
  if (!empty($result)) {
    drush_print(drush_format($result));
  }
  else {
    drush_log(dt('The !cid object in the !bin cache bin was not found.', array('!cid' => $cid, '!bin' => $bin)), 'error');
  }
}