symfony API

sfFunctionCache Class

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to API menu

1.3 API OpenSearch

Packages

You are currently browsing the symfony API for the 1.3 version. Switch to:

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)
    Calls a cacheable function or method (or not if there is already a cache for it).
  • string computeCacheKey($callable, $arguments)
    Computes the cache key for a given callable and the arguments.
  • sfCache getCache()
    Returns the cache instance.
  • __construct($cache)
    Constructor.

Method Details

  • (mixed) call ($callable, $arguments) 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

  • (string) computeCacheKey ($callable, $arguments) Browse code

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

    Computes the cache key for a given callable and the arguments.

    returns The associated cache key

  • (sfCache) getCache () Browse code

    Returns the cache instance.

    returns The sfCache instance

  • __construct ($cache) Browse code

    $cache An sfCache object instance

    Constructor.