(PECL apc >= 3.1.1)
apc_delete_file — Efface un fichier depuis le cache opcode
Efface les fichiers indiqués depuis le cache opcode
Les fichiers à effacer. Accepte une string, array de strings, ou un objet APCIterator.
Cette fonction retourne TRUE en cas de succès ou FALSE si une erreur survient. Ou si keys est un array, alors un tableau vide est retourné en cas de succès, ou un tableau contenant les fichiers en échec sinon.
Exemple #1 Exemple apc_delete_file()
<?php
$filename = 'file.php';
if (apc_compile_file($filename)) {
if (apc_delete_file($filename)) {
echo "Fichier $filename supprimé avec succès depuis le cache APC.", 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);
?>
L'exemple ci-dessus va afficher quelque chose de similaire à :
Fichier $filename supprimé avec succès depuis le cache APC [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)