Cache_Lite_Function::drop

Cache_Lite_Function::drop() – Efface un fichier de cache

Synopsis

require_once 'Cache/Lite/Function.php';

boolean Cache_Lite_Function::drop ( string$functionName , mixed$arg1 , mixed$arg2 , mixed$arg3 , mixed... )

Description

[Depuis Cache_Lite 1.6.0beta1] Efface le fichier de cache de l'appel à la fonction correspondante avec les arguments fournis.

Return value

retourne TRUE si tout s'est bien passé.

Note

This function can not be called statically.

Example

Utilisation classique avec une fonction

<?php

require_once('Cache/Lite/Function.php');

$options = array(
    
'cacheDir' => '/tmp/',
    
'lifeTime' => 3600
);

$cache = new Cache_Lite_Function($options);

$cache->call('function_to_bench'12,45);
$cache->call('function_to_bench'12,45);

// nettoye le fichier de cache correspondant
$cache->drop('function_to_bench'1245);

function 
function_to_bench($arg1$arg2
{
    echo 
"Ceci est la sortie de la fonction function_to_bench($arg1$arg2) !<br>";
    return 
"Ceci est le résultat de la fonction function_to_bench($arg1$arg2) !<br>";
}

?>