function drush_complete_cache_cid

8.0.x drush_complete_cache_cid($type, $command = NULL)
6.x drush_complete_cache_cid($type, $command = NULL)
7.x drush_complete_cache_cid($type, $command = NULL)
5.x drush_complete_cache_cid($type, $command = NULL)
master drush_complete_cache_cid($type, $command = NULL)

Generate a cache id.


$type: The completion type.

$command: The command name (optional), if completions are command specific.

Return value

string Cache id.

3 calls to drush_complete_cache_cid()
drush_complete_cache_clear in includes/
Clears completion caches.
drush_complete_cache_set in includes/
Stores caches for completions.
drush_complete_get in includes/
Retrieves from cache, or generates a listing of completion candidates of a specific type (and optionally, command).


includes/, line 560
Provide completion output for shells.


function drush_complete_cache_cid($type, $command = NULL) {
  // For per-site caches, we include the site root and uri/path in the cache id
  // hash. These are quick to determine, and prevents a bootstrap to site just
  // to get a validated root and URI. Because these are not validated, there is
  // the possibility of cache misses/ but they should be rare, since sites are
  // normally referred to the same way (e.g. a site alias, or using the current
  // directory), at least within a single command completion session.
  // We also static cache them, since we may get differing results after
  // bootstrap, which prevents the caches from being found on the next call.
  static $root, $site;
  if (empty($root)) {
    $root = drush_get_option(array('r', 'root'), drush_locate_root());
    $site = drush_get_option(array('l', 'uri'), drush_site_path());
  return drush_get_cid('complete', array(), array($type, $command, $root, $site));