function JSONCache::writeFile

8.0.x JSONCache.php JSONCache::writeFile($filename, $cache)
7.x JSONCache.php JSONCache::writeFile($filename, $cache)
master JSONCache.php JSONCache::writeFile($filename, $cache)

Serializes data and write it to the given filename.

Parameters

string $filename: Absolute path to filename to write cache data.

$cache: Cache data to serialize and write to $filename.

Overrides FileCache::writeFile

File

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

Namespace

Drush\Cache

Class

JSONCache
JSON cache storage backend.

Code

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