WP_CLI

FileCache::read()publicWP-CLI 1.0

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() WP-CLI 2.8.0-alpha

public function read( $key, $ttl = null ) {
	$filename = $this->has( $key, $ttl );

	if ( $filename ) {
		return file_get_contents( $filename );
	}

	return false;
}