function JSONCache::readFile

8.0.x JSONCache.php JSONCache::readFile($filename)
7.x JSONCache.php JSONCache::readFile($filename)
master JSONCache.php JSONCache::readFile($filename)

Returns the contents of the given filename unserialized.

Parameters

string $filename: Absolute path to filename to read contents from.

Overrides FileCache::readFile

File

lib/Drush/Cache/JSONCache.php, line 16
Definition of Drush\Cache\JSONCache.

Namespace

Drush\Cache

Class

JSONCache
JSON cache storage backend.

Code

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