php8.5
Home/ Manual/ reference / yac/ The Yac class

The Yac class

The Yac class is the interface to the cache. Every instance on the same host is a lightweight handle to one shared cache: all instances read and write the same entries, and creating one does no allocation beyond the handle itself.

Intro

The Yac class is the interface to the cache. Every instance on the same host is a lightweight handle to one shared cache: all instances read and write the same entries, and creating one does no allocation beyond the handle itself.

The optional prefix passed to Yac::__construct is prepended to every key, so several instances (or applications) can share one cache without their keys colliding. Besides the classic cache operations (Yac::add, Yac::set, Yac::get, Yac::delete and Yac::flush), the class provides Yac::info and Yac::dump for inspecting the cache, and overloads property access so that reading or writing an object property reads or writes a cache entry.

Class synopsis

class Yac { }

Properties

_prefix

The key prefix set through Yac::__construct. It is prepended to every key used with the instance; no separator is inserted, so include one in the prefix when needed. The prefix may not exceed YAC_MAX_KEY_LEN (48) bytes.

Yac

In this section

Source: reference/yac/yac.xml · from the official PHP manual (php/doc-en)