API > eden > cache.php
View Source

class Eden_Cache

This class allows the use of setting up multiple file cache locations. A file cache is a collection of files with data that was previously computed. We cache when computing the same data is expensive on memory or time. Once the data is stored in the file cache, it can be used in the future by accessing the cached copy rather than recomputing the original data.

Public Methods

public function build()

Builds the cache into memory

Returns Eden_CacheModel

public function get($key, $default = NULL)

Gets a data cache

Arguments

  1. *string the key to the data

Returns mixed

public function getCreated($key)

Gets the unix time of when a cache has been created

Arguments

  1. *string the key to the data

Returns int

public function getKeys()

returns a list of keys

Returns array

public function keyExists($key)

Checks if a key is cached

Arguments

  1. *string the key to the data

Returns bool

public function remove($key)

Sets a data cache

Arguments

  1. *string the key to the data

Returns this

public function set($key, $path, $data)

Sets a data cache

Arguments

  1. *string the key to the data
  2. *string the path of the cache
  3. *mixed the data to be cached

Returns Eden_CacheModel

public function setKey($key)

Sets a cache key file

Arguments

  1. *string the name of the key file

Returns Eden_CacheModel

public function setRoot($root)

Sets a cache path root

Arguments

  1. string the root path

Returns Eden_CacheModel

class Eden_Cache_Error

Cache Errors


© 2012 Openovate Labs. All rights reserved.