symfony API

sfFileCache Class

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to API menu

1.0 API OpenSearch

Packages

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

Inheritence

sfFunctionCache  <  sfFileCache  <  sfCache

Method Summary

  • boolean clean()
    Cleans the cache.
  • boolean cleanDir(, , )
    Recursive function for cleaning cache file in the given directory.
  • string get(, , )
    Tests if a cache is available and (if yes) returns it.
  • getCacheDir()
  • boolean getFileLocking()
    Gets the value of the fileLocking option.
  • array getFileName(, )
    Makes a file name (with path).
  • boolean getWriteControl()
    Gets the value of the writeControl option.
  • boolean has(, , )
    Returns true if there is a cache for the given id and namespace.
  • string hash($data)
    Makes a control key with the string containing datas.
  • initialize()
    Initializes the cache.
  • int lastModified()
    Returns the cache last modification time.
  • string read(, )
    Reads the cache file and returns the content.
  • boolean remove(, )
    Removes a cache file.
  • boolean set(, , )
    Saves some data in a cache file.
  • setCacheDir()
    Sets the cache root directory.
  • setFileLocking()
    Enables / disables file locking.
  • setSuffix()
    Sets the suffix for cache files.
  • setWriteControl()
    Enables / disables write control.
  • boolean unlink()
    Removes a file.
  • boolean write(, , )
    Writes the given data in the cache file.
  • boolean writeAndControl(, , )
    Writes the given data in the cache file and controls it just after to avoid corrupted cache entries.
  • __construct()
    Constructor.

Methods inherited from sfCache

clean , get , getLifeTime , has , lastModified , remove , set , setLifeTime

Method Details

  • (boolean) clean () Browse code

    Cleans the cache.


    If no namespace is specified all cache files will be destroyed
    else only cache files of the specified namespace will be destroyed.

    returns true if no problem

  • (boolean) cleanDir (, , ) Browse code

    Recursive function for cleaning cache file in the given directory.

    returns true if no problem

    throws sfCacheException

  • (string) get (, , ) Browse code

    Tests if a cache is available and (if yes) returns it.

    returns Data of the cache (or null if no cache available)

  • getCacheDir () Browse code

  • (boolean) getFileLocking () Browse code

    Gets the value of the fileLocking option.

  • (array) getFileName (, ) Browse code

    Makes a file name (with path).

    returns An array containing the path and the file name

  • (boolean) getWriteControl () Browse code

    Gets the value of the writeControl option.

  • (boolean) has (, , ) Browse code

    Returns true if there is a cache for the given id and namespace.

    returns true if the cache exists, false otherwise

  • (string) hash ($data) Browse code

    $data data

    Makes a control key with the string containing datas.

    returns control key

  • initialize () Browse code

    Initializes the cache.

  • (int) lastModified () Browse code

    Returns the cache last modification time.

    returns The last modification time

  • (string) read (, ) Browse code

    Reads the cache file and returns the content.

    returns The content of the cache file.

    throws sfCacheException

  • (boolean) remove (, ) Browse code

    Removes a cache file.

    returns true if no problem

  • (boolean) set (, , ) Browse code

    Saves some data in a cache file.

    returns true if no problem

  • setCacheDir () Browse code

    Sets the cache root directory.

  • setFileLocking () Browse code

    Enables / disables file locking.

  • setSuffix () Browse code

    Sets the suffix for cache files.

  • setWriteControl () Browse code

    Enables / disables write control.

  • (boolean) unlink () Browse code

    Removes a file.

    returns true if no problem

  • (boolean) write (, , ) Browse code

    Writes the given data in the cache file.

    returns true if ok

    throws sfCacheException

  • (boolean) writeAndControl (, , ) Browse code

    Writes the given data in the cache file and controls it just after to avoid corrupted cache entries.

    returns true if the test is ok

  • __construct () Browse code

    Constructor.