API > eden > memcache.php
View Source

class Eden_Memcache

Definition of available memcache methods. Memcache module provides handy procedural and object oriented interface to memcached, highly effective caching daemon, which was especially designed to decrease database load in dynamic web applications. We cache when computing the same data is expensive on memory or time. Once the actual data is stored in memory, it can be used in the future by accessing the cached copy rather than recomputing the original data.

Public Methods

public function addServer($host = 'localhost', $port = 11211, $persistent = true, $weight = NULL, $timeout = 1)

Add a memcached server to connection pool

Arguments

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

Returns bool

public function clear()

Flushes the cache return this

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

Gets a data cache

Arguments

  1. string|array the key to the data
  2. int MemCache flag

Returns variable

public function remove($key)

deletes data of a cache

Arguments

  1. string the key to the data

Returns this

public function set($key, $data, $flag = NULL, $expire = NULL)

Sets a data cache

Arguments

  1. string the key to the data
  2. variable the data to be cached
  3. int MemCache flag
  4. int expire

Returns bool

class Eden_Memcache_Error

Memcache Errors

Constants

  • NOT_INSTALLED: Memcache is not installed.

© 2012 Openovate Labs. All rights reserved.