Cache_Lite_Function::drop

Cache_Lite_Function::drop() – Drop a cache file

Synopsis

require_once 'Cache/Lite/Function.php';

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

Description

[since Cache_Lite 1.6.0beta1] Drop the cache file of the corresponding function call with given arguments.

Return value

returns true if ok

Note

This function can not be called statically.

Example

classical using with a function

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

// clean the corresponding cache file
$cache->drop('function_to_bench'1245);

function 
function_to_bench($arg1$arg2
{
    echo 
"This is the output of the function function_to_bench($arg1$arg2) !<br>";
    return 
"This is the result of the function function_to_bench($arg1$arg2) !<br>";
}

?>
Calls a cacheable function or method (or not if there is already a cache for it) (Previous) Constructor (Next)
Last updated: Sat, 16 Feb 2019 — Download Documentation
Do you think that something on this page is wrong? Please file a bug report.
View this page in:
  • English

User Notes:

There are no user contributed notes for this page.