Automattic\WooCommerce\Internal\Api

QueryCache::is_opcache_usableprivateWC 1.0

Whether the OPcache file backend can be used for this request.

Memoised per request: the underlying checks (opcache_get_status, filesystem writability) don't change mid-request and are wasteful to repeat across the read and write paths.

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

Хуков нет.

Возвращает

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

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

// private - только в коде основоного (родительского) класса
$result = $this->is_opcache_usable(): bool;

Код QueryCache::is_opcache_usable() WC 11.0.1

private function is_opcache_usable(): bool {
	if ( null !== $this->opcache_usable ) {
		return $this->opcache_usable;
	}

	$this->opcache_usable = $this->compute_is_opcache_usable();
	return $this->opcache_usable;
}