symfony API

sfFileCache Class

You are currently browsing
the website for symfony 1

Visit the Symfony2 website

« Back to API menu


You are currently browsing the symfony API for the 1.4 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.

Cache class that stores content in files.


sfFileCache  <  sfCache

Method Summary

Methods inherited from sfCache

clean , get , getBackend , getLastModified , getLifetime , getMany , getOption , getTimeout , has , initialize , patternToRegexp , remove , removePattern , set , setOption , __construct

Method Details

  • clean ()

    @see sfCache

  • get ()

    @see sfCache

  • (string) getFilePath ($key)

    $key The cache key

    Converts a cache key to a full path.

    returns The full path to the cache file

  • getLastModified ()

    @see sfCache

  • getTimeout ()

    @see sfCache

  • has ()

    @see sfCache

  • initialize ()

    Initializes this sfCache instance.

    Available options:

    * cache_dir: The directory where to put cache files

    * see sfCache for options available for all drivers

  • isValid ()

  • (array) read ($path, $type)

    $path The file path
    $type The type of data you want to be returned sfFileCache::READ_DATA: The cache content sfFileCache::READ_TIMEOUT: The timeout sfFileCache::READ_LAST_MODIFIED: The last modification timestamp

    Reads the cache file and returns the content.

    returns the (meta)data of the cache file. E.g. $data[sfFileCache::READ_DATA]

    throws sfCacheException

  • remove ()

    @see sfCache

  • removePattern ()

    @see sfCache

  • set ()

    @see sfCache

  • setcache_dir ($cache_dir)

    $cache_dir The directory where to put the cache files

    Sets the cache root directory.

  • (boolean) write ($path, $data, $timeout)

    $path The file path
    $data The data to put in cache
    $timeout The timeout timestamp

    Writes the given data in the cache file.

    returns true if ok, otherwise false

    throws sfCacheException