略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: apc_delete_file

2024-04-29

apc_delete_file

(PECL apc >= 3.1.1)

apc_delete_fileDeletes files from the opcode cache

说明

apc_delete_file ( mixed $keys ) : mixed

Deletes the given files from the opcode cache.

参数

keys

The files to be deleted. Accepts a string, array of strings, or an APCIterator object.

返回值

成功时返回 TRUE, 或者在失败时返回 FALSE。 Or if keys is an array, then an empty array is returned on success, or an array of failed files is returned.

范例

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)

参见

  • apc_clear_cache() - 清除APC缓存
  • apc_delete() - 从用户缓存中删除某个变量
  • apc_exists() - 检查APC中是否存在某个或者某些key
add a noteadd a note

User Contributed Notes

There are no user contributed notes for this page.

官方地址:https://www.php.net/manual/en/function.apc-delete-file.php

冷却塔厂家 广告
中文GPT4.0无需注册 广告
北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3