在线文档教程
PHP

apcu_cache_info

apcu_cache_info

(PECL apcu >= 4.0.0)

apcu_cache_info - 从 APCu 的数据存储中检索缓存的信息

描述

array apcu_cache_info ([ bool $limited = false ] )

从 APC 的数据存储中检索缓存的信息和元数据。

参数

limited

如果limitedTRUE,则返回值将排除单个缓存条目列表。当尝试优化呼叫以进行统计收集时,这非常有用。

返回值

缓存数据(和元数据)数组或FALSE失败

注意:如果 apcu_cache_info()无法检索 APC 缓存数据,将会发出警告。这通常发生在 APC 未启用时。

Changelog

VersionDescription
3.0.11The limited parameter was introduced.
3.0.16The "filehits" option for the cache_type parameter was introduced.

例子

Example #1 A apcu_cache_info() example

<?php print_r(apcu_cache_info() ?>

上面的例子会输出类似于:

Array ( [num_slots] => 2000 [ttl] => 0 [num_hits] => 9 [num_misses] => 3 [start_time] => 1123958803 [cache_list] => Array ( [0] => Array ( [filename] => /path/to/apcu_test.php [device] => 29954 [inode] => 1130511 [type] => file [num_hits] => 1 [mtime] => 1123960686 [creation_time] => 1123960696 [deletion_time] => 0 [access_time] => 1123962864 [ref_count] => 1 [mem_size] => 677 ) [1] => Array (...iterates for each cached file) )