WP_CLI

FileCache::export()publicWP-CLI 1.0

Copy a file out of the cache

Метод класса: FileCache{}

Хуков нет.

Возвращает

true|false.

Использование

$FileCache = new FileCache();
$FileCache->export( $key, $target, $ttl );
$key(строка) (обязательный)
cache key
$target(строка) (обязательный)
target filename
$ttl(int)
time to live
По умолчанию: null

Код FileCache::export() WP-CLI 2.8.0-alpha

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

	if ( $filename && $this->ensure_dir_exists( dirname( $target ) ) ) {
		return copy( $filename, $target );
	}

	return false;
}