WP_CLI
FileCache::read
Read from cache file
Метод класса: FileCache{}
Хуков нет.
Возвращает
true|false|Строку. file contents or false
Использование
$FileCache = new FileCache(); $FileCache->read( $key, $ttl );
- $key(строка) (обязательный)
- cache key.
- $ttl(int)
- time to live.
По умолчанию: null
Код FileCache::read() FileCache::read 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;
}