function DrushFileCache::getMultiple

6.x cache.inc DrushFileCache::getMultiple(&$cids)
5.x cache.inc DrushFileCache::getMultiple(&$cids)

Return data from the persistent cache when given an array of cache IDs.

Parameters

$cids: An array of cache IDs for the data to retrieve. This is passed by reference, and will have the IDs successfully returned from cache removed.

Return value

An array of the items successfully returned from cache indexed by cid.

Overrides DrushCacheInterface::getMultiple

1 call to DrushFileCache::getMultiple()
DrushFileCache::get in includes/cache.inc
Return data from the persistent cache.

File

includes/cache.inc, line 324
Drush cache API

Class

DrushFileCache
Default cache implementation.

Code

function getMultiple(&$cids) {
  try {
    $cache = array();
    foreach ($cids as $cid) {
      $filename = $this->getFilePath($cid);
      if (!file_exists($filename)) {
        throw new Exception;
      }

      $item = $this->readFile($filename);
      if ($item) {
        $cache[$cid] = $item;
      }
    }
    $cids = array_diff($cids, array_keys($cache));
    return $cache;
  }
  catch (Exception $e) {
    return array();
  }
}