symfony API

sfFunctionCache Class

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to API menu

1.2 API OpenSearch

Packages

You are currently browsing the symfony API for the 1.2 version. Switch to:
This version of symfony is not maintained anymore.
If some of your projects still use this version, consider upgrading as soon as possible.

This class can be used to cache the result and output of any PHP callable (function and method calls).

Method Summary

  • mixed call($callable, $arguments = array())
    Calls a cacheable function or method (or not if there is already a cache for it).
  • __construct((sfCache) $cache)
    Constructor.

Method Details

  • (mixed) call ($callable, $arguments = array()) Browse code

    $callable A PHP callable
    $arguments An array of arguments to pass to the callable

    Calls a cacheable function or method (or not if there is already a cache for it).


    Arguments of this method are read with func_get_args. So it doesn't appear in the function definition.

    The first argument can be any PHP callable:

    $cache->call('functionName', array($arg1, $arg2)); $cache->call(array($object, 'methodName'), array($arg1, $arg2));

    returns The result of the function/method

  • __construct ((sfCache) $cache) Browse code

    $cache An sfCache object instance

    Constructor.