symfony API

sfFileCache Class

« Back to API menu

action

addon

autoload

cache

command

config

controller

creole

database

debug

exception

filter

form

generator

helper

i18n

log

plugin

propel

request

response

routing

storage

task

test

user

util

validator

view

widget

You are currently browsing the symfony documentation for the 1.1 version. Switch to:

Cache class that stores content in files.

Inheritence

sfFileCache  <  sfCache

Method Summary

  • removePattern($pattern)
  • getTimeout($key)
  • string read($path, $type = self::READ_DATA)
    Reads the cache file and returns the content.
  • string getFilePath($key)
    Converts a cache key to a full path.
  • initialize($options = array())
    Initializes this sfCache instance.
  • get($key, $default = null)
  • remove($key)
  • set($key, $data, $lifetime = null)
  • clean($mode = sfCache::ALL)
  • getLastModified($key)
  • setcache_dir($cache_dir)
    Sets the cache root directory.
  • has($key)
  • boolean write($path, $data, $timeout)
    Writes the given data in the cache file.

Methods inherited from sfCache

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

Method Details

  • removePattern ($pattern)

  • getTimeout ($key)

  • (string) read ($path, $type = self::READ_DATA)

    $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 content of the cache file.

    throws sfCacheException

  • (string) getFilePath ($key)

    $key The cache key

    Converts a cache key to a full path.

    returns The full path to the cache file

  • initialize ($options = array())

    Initializes this sfCache instance.

    Available options:
    * cache_dir: The directory where to put cache files
    * see sfCache for options available for all drivers

  • get ($key, $default = null)

  • remove ($key)

  • set ($key, $data, $lifetime = null)

  • clean ($mode = sfCache::ALL)

  • getLastModified ($key)

  • setcache_dir ($cache_dir)

    $cache_dir The directory where to put the cache files

    Sets the cache root directory.

  • has ($key)

  • (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