AloFramework documentation
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Todo
  • Download

Namespaces

  • Alo
    • Cache
    • Controller
    • Db
    • Exception
    • Session
    • Statics
    • Test
    • Validators
  • Controller
  • None
  • PHP

Classes

  • AbstractCache
  • MemcachedWrapper

Class MemcachedWrapper

A wrapper for PHP's Memcached extension. Will try to use the Memcached class first, if it doesn't exist, will use Memcache.

Alo\Cache\AbstractCache
Extended by Alo\Cache\MemcachedWrapper
Namespace: Alo\Cache
Package: Cache
Author: Art <a.molcanovas@gmail.com>
Located at sys/class/alo/cache/memcachedwrapper.php

Methods summary

public
# __construct( boolean $initialise_default_server = true )

Instantiates the class

Instantiates the class

Parameters

$initialise_default_server
boolean
$initialise_default_server Whether to add a server on construct

Author

Art <a.molcanovas@gmail.com>

Overrides

Alo\Cache\AbstractCache::__construct
public string|null
# getLoadedClass( )

Returns the loaded cache class

Returns the loaded cache class

Returns

string|null

Author

Art <a.molcanovas@gmail.com>
public boolean
# purge( )

Clears all items from cache

Clears all items from cache

Returns

boolean

Author

Art <a.molcanovas@gmail.com>
public boolean
# addServer( string $ip = ALO_MEMCACHED_IP, string $port = ALO_MEMCACHED_PORT, integer $weight = 1 )

Adds a server to the pool

Adds a server to the pool

Parameters

$ip
string
$ip The server IP
$port
string
$port The server port
$weight
integer
$weight The server's weight, ie how likely it is to be used

Returns

boolean

Author

Art <a.molcanovas@gmail.com>
public array
# getStats( )

Gets cache process info

Gets cache process info

Returns

array

Author

Art <a.molcanovas@gmail.com>
public boolean
# delete( string $key )

Deletes a memcache key

Deletes a memcache key

Parameters

$key
string
$key The key

Returns

boolean

Author

Art <a.molcanovas@gmail.com>
public mixed
# get( string $id )

Gets a cached value

Gets a cached value

Parameters

$id
string
$id The value's key

Returns

mixed

Author

Art <a.molcanovas@gmail.com>
public boolean
# set( string $key, mixed $var, integer $expire = 3600 )

Sets a cached key/value pair

Sets a cached key/value pair

Parameters

$key
string
$key The key identifier
$var
mixed
$var The value to set
$expire
integer
$expire When to expire the set data. Defaults to 3600s.

Returns

boolean

Author

Art <a.molcanovas@gmail.com>
protected array
# getAllMemcached( )

The memcached version of getAll()

The memcached version of getAll()

Returns

array

Author

Art <a.molcanovas@gmail.com>
protected array
# getAllMemcache( )

The Memcache version of getAll()

The Memcache version of getAll()

Returns

array

Author

Art <a.molcanovas@gmail.com>
public array
# getAll( )

Return all cached keys and values

Return all cached keys and values

Returns

array

Author

Art <a.molcanovas@gmail.com>

Methods inherited from Alo\Cache\AbstractCache

__get(), __isset(), __set(), __unset(), deleteWithPrefix(), deleteWithSuffix(), is_available()

Magic methods summary

Constants summary

integer CLASS_MEMCACHED 1
#

Defines the class as Memcached

Defines the class as Memcached

integer CLASS_MEMCACHE 2
#

Defines the class as Memcache

Defines the class as Memcache

Properties summary

protected Memcache|Memcached $mc
#

The memcached instance

The memcached instance

protected static boolean $loaded
#

Whether the relevant cache extension is loaded

Whether the relevant cache extension is loaded

AloFramework documentation API documentation generated by ApiGen 2.8.0