Yac::dumpDump cache entries for inspection Description
public array Yac::dump(int
$limit = 100, int $offset = 0)Dumps metadata of the entries currently stored in the cache. The values themselves are not returned. Parameters
Return ValuesAn array with one element per dumped entry. Each element is itself an array describing the entry:
ExamplesExample #1 Yac::dump example The above example will output something similar to:
Array
(
[0] => Array
(
[index] => 12345
[hash] => 14463105906481965911
[crc] => 0
[ttl] => 0
[k_len] => 3
[v_len] => 3
[size] => 0
[atime] => 1725955200
[hits] => 0
[embedded] => 1
[key] => foo
)
[1] => Array
(
[index] => 12987
[hash] => 15132029420525657053
[crc] => 0
[ttl] => 0
[k_len] => 3
[v_len] => 3
[size] => 0
[atime] => 1725955200
[hits] => 0
[embedded] => 1
[key] => baz
)
)
Entries are listed in slot order, not in the order they were stored.
Embedded entries (short scalars kept inside the slot itself) have
Example #2 Paging through a large cache
The above example will output something similar to: int(100) Fewer entries than requested are returned when the cache holds fewer entries than the requested page covers, and an empty array is returned once the offset points past the last occupied slot. See Also
|