WP_CLI

FileCache::__construct()publicWP-CLI 1.0

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

Хуков нет.

Возвращает

null. Ничего (null).

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

$FileCache = new FileCache();
$FileCache->__construct( $cache_dir, $ttl, $max_size, $whitelist );
$cache_dir(строка) (обязательный)
location of the cache
$ttl(int) (обязательный)
cache files default time to live (expiration)
$max_size(int) (обязательный)
max total cache size
$whitelist(строка)
List of characters that are allowed in path names (used in a regex character class)
По умолчанию: 'a-z0-9._-'

Код FileCache::__construct() WP-CLI 2.8.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;
	}

}