Zend_Cache_Frontend_Function caches the results of function
calls. It has a single main method named call() which takes
a function name and parameters for the call in an array.
Table 21. Function Frontend Options
| Option | Data Type | Default Value | Description |
|---|---|---|---|
| cache_by_default | Boolean | TRUE |
if TRUE, function calls will be cached by
default
|
| cached_functions | Array | function names which will always be cached | |
| non_cached_functions | Array | function names which must never be cached |
Using the call() function is the same as using
call_user_func_array() in PHP:
<?php
$cache->call('veryExpensiveFunc', $params);
// $params is an array
// For example to call veryExpensiveFunc(1, 'foo', 'bar') with
// caching, you can use
// $cache->call('veryExpensiveFunc', array(1, 'foo', 'bar'))
Zend_Cache_Frontend_Function is smart enough to cache both
the return value of the function and its internal output.
Note
You can pass any built in or user defined function with the exception of
array(), echo(),
empty(), eval(),
exit(), isset(),
list(), print() and
unset().




