WP_CLI

FileCache::export │ public │ WP-CLI 1.0

Copy a file out of the cache

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

Хуков нет.

Возвращает

bool.

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

$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.13.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;
}