WP_CLI
FileCache::export()
Copy a file out of the cache
Method of the class: FileCache{}
No Hooks.
Return
true|false
.
Usage
$FileCache = new FileCache(); $FileCache->export( $key, $target, $ttl );
- $key(string) (required)
- cache key
- $target(string) (required)
- target filename
- $ttl(int)
- time to live
Default: null
FileCache::export() FileCache::export code 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; }