WP_CLI
FileCache::read
Read from cache file
Method of the class: FileCache{}
No Hooks.
Returns
true|false|String. file contents or false
Usage
$FileCache = new FileCache(); $FileCache->read( $key, $ttl );
- $key(string) (required)
- cache key.
- $ttl(int)
- time to live.
Default: null
FileCache::read() FileCache::read code WP-CLI 2.13.0-alpha
public function read( $key, $ttl = null ) {
$filename = $this->has( $key, $ttl );
if ( $filename ) {
return file_get_contents( $filename );
}
return false;
}