PHP Doku:: Deletes files from the opcode cache - function.apc-delete-file.html

Verlauf / Chronik / History: (44) anzeigen

Sie sind hier:
Doku-StartseitePHP-HandbuchFunktionsreferenzDas Verhalten von PHP beeinflussenAlternativer PHP CacheAPC Funktionenapc_delete_file

Ein Service von Reinhard Neidl - Webprogrammierung.

APC Funktionen

<<apc_define_constants

apc_delete>>

apc_delete_file

(PECL apc >= 3.1.1)

apc_delete_fileDeletes files from the opcode cache

Beschreibung

mixed apc_delete_file ( mixed $keys )

Deletes the given files from the opcode cache.

Parameter-Liste

keys

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

Rückgabewerte

Gibt bei Erfolg TRUE zurück. Im Fehlerfall wird FALSE zurückgegeben. Or if keys is an array, then an empty array is returned on success, or an array of failed files is returned.

Beispiele

Beispiel #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);
?>

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

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)

Siehe auch


Keine BenutzerBeiträge.
- Beiträge aktualisieren...



PHP Powered Diese Seite bei php.net
The PHP manual text and comments are covered by the Creative Commons Attribution 3.0 License © the PHP Documentation Group - Impressum - mail("TO:Reinhard Neidl",...)