WP_CLI
FileCache::__construct
Method of the class: FileCache{}
No Hooks.
Returns
null. Nothing (null).
Usage
$FileCache = new FileCache(); $FileCache->__construct( $cache_dir, $ttl, $max_size, $whitelist );
- $cache_dir(string) (required)
- location of the cache.
- $ttl(int) (required)
- cache files default time to live (expiration).
- $max_size(int) (required)
- max total cache size.
- $whitelist(string)
- List of characters that are allowed in path names (used in a regex character class).
Default: 'a-z0-9._-'
FileCache::__construct() FileCache:: construct code WP-CLI 2.13.0-alpha
public function __construct( $cache_dir, $ttl, $max_size, $whitelist = 'a-z0-9._-' ) {
$this->root = Utils\trailingslashit( $cache_dir );
$this->ttl = (int) $ttl;
$this->max_size = (int) $max_size;
$this->whitelist = $whitelist;
if ( ! $this->ensure_dir_exists( $this->root ) ) {
$this->enabled = false;
}
}