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

Namespaces

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

Classes

  • AbstractCache
  • MemcachedWrapper
  • RedisWrapper

Class AbstractCache

The abstract cache class

Direct known subclasses

Alo\Cache\MemcachedWrapper, Alo\Cache\RedisWrapper

Abstract
Namespace: Alo\Cache
Package: Cache
Author: Art <a.molcanovas@gmail.com>
Located at sys/class/alo/cache/abstractcache.php

Methods summary

public
# __construct( )

Instantiates the class

Instantiates the class

Author

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

Checks if a caching extension is available

Checks if a caching extension is available

Returns

boolean

Author

Art <a.molcanovas@gmail.com>
public mixed
# __call( string $method, array $args )

Calls a method of the caching client

Calls a method of the caching client

Parameters

$method
string
$method The method
$args
array
$args Method args

Returns

mixed
Whatever the method returns

Author

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

Key getter

Key getter

Parameters

$key
string
$key The key

Returns

mixed

Author

Art <a.molcanovas@gmail.com>
public boolean
# __set( string $key, mixed $val )

Sets a value with its default expiration time

Sets a value with its default expiration time

Parameters

$key
string
$key The key
$val
mixed
$val The value

Returns

boolean

Author

Art <a.molcanovas@gmail.com>
abstract 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>
abstract 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>
public boolean
# __isset( string $key )

Checks if a key is set in cache

Checks if a key is set in cache

Parameters

$key
string
$key The key

Returns

boolean

Author

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

Removes a key from cache

Removes a key from cache

Parameters

$key
string
$key The key

Author

Art <a.molcanovas@gmail.com>
abstract 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>
abstract public boolean
# purge( )

Clears all items from cache

Clears all items from cache

Returns

boolean

Author

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

Adds a server to the pool

Adds a server to the pool

Parameters

$ip
string
$ip The server IP
$port
integer
$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 Alo\Cache\AbstractCache
# deleteWithPrefix( string $prefix )

Deletes all cached entries with the supplied prefix

Deletes all cached entries with the supplied prefix

Parameters

$prefix
string
$prefix The prefix

Returns

Alo\Cache\AbstractCache

Author

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

Return all cached keys and values

Return all cached keys and values

Returns

array

Author

Art <a.molcanovas@gmail.com>
public Alo\Cache\AbstractCache
# deleteWithSuffix( string $suffix )

Deletes all cached entries with the supplied suffix

Deletes all cached entries with the supplied suffix

Parameters

$suffix
string
$suffix The suffix

Returns

Alo\Cache\AbstractCache

Author

Art <a.molcanovas@gmail.com>

Magic methods summary

Properties summary

private static array $classes
#

Classes to check in "is_available()"

Classes to check in "is_available()"

protected Redis|Memcache|Memcached $client
#

The abstract client

The abstract client

AloFramework documentation API documentation generated by ApiGen 2.8.0