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() - 锟斤拷锟紸PC锟斤拷锟斤拷
  • apc_delete() - 锟斤拷锟矫伙拷锟斤拷锟斤拷锟斤拷删锟斤拷某锟斤拷锟斤拷锟斤拷
  • apc_exists() - 锟斤拷锟紸PC锟斤拷锟角凤拷锟斤拷锟侥筹拷锟斤拷锟斤拷锟侥承﹌ey