symfony API

sfFunctionCache Class

« Back to API menu

1.1 API OpenSearch

Packages

You are currently browsing the symfony API for the 1.1 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)
    Calls a cacheable function or method (or not if there is already a cache for it).
  • __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

  • __construct ($cache) Browse code

    $cache An sfCache object instance

    Constructor.

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting.
Sensio Labs also supports several large Open-Source projects.