class DrushJSONCache

  1. 6.x includes/cache.inc DrushJSONCache
  2. 5.x includes/cache.inc DrushJSONCache

JSON cache storage backend.

Hierarchy

Expanded class hierarchy of DrushJSONCache

Members

Contains filters are case sensitive
Namesort descending Modifiers Type Description
DrushFileCache::$bin protected property
DrushFileCache::cacheDirectory function
DrushFileCache::clear function Expire data from the cache. If called without arguments, expirable entries will be cleared from all known cache bins. Overrides DrushCacheInterface::clear
DrushFileCache::get function Return data from the persistent cache. Overrides DrushCacheInterface::get
DrushFileCache::getFilePath protected function Converts a cache id to a full path.
DrushFileCache::getMultiple function Return data from the persistent cache when given an array of cache IDs. Overrides DrushCacheInterface::getMultiple
DrushFileCache::isEmpty function Check if a cache bin is empty. Overrides DrushCacheInterface::isEmpty
DrushFileCache::set function Store data in the persistent cache. Overrides DrushCacheInterface::set
DrushFileCache::__construct function Constructor. Overrides DrushCacheInterface::__construct
DrushJSONCache::EXTENSION constant Overrides DrushFileCache::EXTENSION
DrushJSONCache::readFile function Overrides DrushFileCache::readFile
DrushJSONCache::writeFile function Overrides DrushFileCache::writeFile

File

includes/cache.inc, line 428
Drush cache API

View source
class DrushJSONCache extends DrushFileCache {
  const EXTENSION = '.json';

  function readFile($filename) {
    $item = file_get_contents($filename);
    return $item ? (object) drush_json_decode($item) : FALSE;
  }

  function writeFile($filename, $cache) {
    return file_put_contents($filename, drush_json_encode($cache));
  }
}