function _drush_cache_command_set

8.0.x cache_8.inc _drush_cache_command_set($cid, $data, $bin, $expire, $tags)
8.0.x cache.inc _drush_cache_command_set($cid, $data, $bin, $expire, $tags)
7.x cache_8.inc _drush_cache_command_set($cid, $data, $bin, $expire, $tags)
7.x cache.inc _drush_cache_command_set($cid, $data, $bin, $expire, $tags)
master cache_8.inc _drush_cache_command_set($cid, $data, $bin, $expire, $tags)
master cache.inc _drush_cache_command_set($cid, $data, $bin, $expire, $tags)
1 string reference to '_drush_cache_command_set'
drush_cache_command_set in commands/core/cache.drush.inc
Set an object in the cache.

File

commands/core/drupal/cache_8.inc, line 25
Engine for the cache commands.

Code

function _drush_cache_command_set($cid, $data, $bin, $expire, $tags) {
  if (is_null($bin)) {
    $bin = _drush_cache_bin_default();
  }

  // Convert the "expire" argument to a valid value for Drupal's cache_set().
  if ($expire == 'CACHE_TEMPORARY') {
    $expire = Cache::TEMPORARY;
  }
  if (!isset($expire) || $expire == 'CACHE_PERMANENT') {
    $expire = Cache::PERMANENT;
  }

  return \Drupal::cache($bin)->set($cid, $data, $expire, $tags);
}