* option in drushrc.php.
*/
+use Drush\Drush;
use Drush\Log\LogLevel;
/**
function drush_cache_get($cid, $bin = 'default') {
$ret = _drush_cache_get_object($bin)->get($cid);
$mess = $ret ? "HIT" : "MISS";
- drush_log(dt("Cache !mess cid: !cid", array('!mess' => $mess, '!cid' => $cid)), LogLevel::DEBUG);
+ drush_log(dt("Cache !mess cid: !cid", ['!mess' => $mess, '!cid' => $cid]), LogLevel::DEBUG);
return $ret;
}
*/
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)), LogLevel::DEBUG);
+ if ($ret) drush_log(dt("Cache SET cid: !cid", ['!cid' => $cid]), LogLevel::DEBUG);
return $ret;
}
* Return drush cache bins and any bins added by hook_drush_flush_caches().
*/
function drush_cache_get_bins() {
- $drush = array('default');
- return array_merge(drush_command_invoke_all('drush_flush_caches'), $drush);
+ $drush = ['default'];
+ return $drush;
+ // return array_merge(drush_command_invoke_all('drush_flush_caches'), $drush);
}
/**
* @return
* A cache id string.
*/
-function drush_get_cid($prefix, $contexts = array(), $params = array()) {
- $cid = array();
+function drush_get_cid($prefix, $contexts = [], $params = []) {
+ $cid = [];
foreach ($contexts as $context) {
$c = drush_get_context($context);
$cid[] = $param;
}
- return DRUSH_VERSION . '-' . $prefix . '-' . md5(implode("", $cid));
+ return Drush::getVersion() . '-' . $prefix . '-' . md5(implode("", $cid));
}