首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

apc_delete_file

(PECL apc >= 3.1.1)

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

描述

代码语言:javascript
复制
mixed apc_delete_file ( mixed $keys )

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

参数

keys

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

返回值

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

示例

Example #1 apc_delete_file() example

代码语言:javascript
复制
<?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);
?>

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

代码语言:javascript
复制
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 →

扫码关注腾讯云开发者

领取腾讯云代金券