PHP

apc_delete_file

apc_delete_file

(PECL apc >= 3.1.1)

apc_delete_file - 从操作码缓存中删除文件

描述

mixed apc_delete_file ( mixed $keys )

从操作码缓存中删除给定的文件。

参数

keys

要删除的文件。接受字符串,字符串数组或APCIterator对象。

返回值

成功时返回TRUE或失败时返回FALSE。或者如果keys是数组,则成功时返回空数组,否则返回失败文件数组。

示例

Example #1 apc_delete_file() example

<?php $filename = 'file.php'; if (apc_compile_file($filename)) {     if (apc_delete_file($filename)) {         echo "Successfully deleted file $filename from APC cache.", PHP_EOL;     } } if (apc_compile_file($filename)) {     if ($good = apc_delete_file(array($filename, 'donotexist.php'))) {         var_dump($good     } } $bad = apc_delete_file('donotexist.php' var_dump($bad ?>

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

Successfully deleted file file.php from APC cache. [Mon May 24 09:30:33 2010] [apc-warning] Could not stat file donotexist.php, unable to delete from cache. in /tmp/test.php on line 13. array(1) { [0]=> string(14) "donotexist.php" } [Mon May 24 09:30:33 2010] [apc-warning] Could not stat file donotexist.php, unable to delete from cache. in /tmp/test.php on line 18. bool(false)

See Also

  • apc_clear_cache() - 清除APC缓存

  • apc_delete() - 从缓存中删除存储的变量

  • apc_exists() - 检查APC密钥是否存在

← apc_define_constants

apc_delete →