AloFramework Cache 1.0 API
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Todo

Namespaces

  • AloFramework
    • Cache
      • Clients
      • Config
  • PHP

Classes

  • CacheItem

Interfaces

  • ClientInterface

Exceptions

  • CacheException

Interface ClientInterface

The AloFramework cache interface

AloFramework\Cache\ClientInterface implements ArrayAccess, Countable, IteratorAggregate

Direct known implementers

AloFramework\Cache\Clients\RedisClient

Namespace: AloFramework\Cache
Author: Art a.molcanovas@gmail.com
Located at ClientInterface.php

Methods summary

public boolean
# connect( string $ip = null, integer $port = null )

Connect to the cache server

Connect to the cache server

Parameters

$ip
Server IP
$port
Server port

Returns

boolean
Whether the connection succeeded

Author

Art a.molcanovas@gmail.com
public AloFramework\Cache\ClientInterface
# delete( string|array $key )

Deletes a cached item

Deletes a cached item

Parameters

$key
Item key or array of keys

Returns

AloFramework\Cache\ClientInterface

Author

Art a.molcanovas@gmail.com
public boolean
# exists( string $key )

Check if the key exists

Check if the key exists

Parameters

$key
The key

Returns

boolean

Author

Art a.molcanovas@gmail.com
public mixed
# getKey( string $key )

Returns a cached item

Returns a cached item

Parameters

$key
Item key

Returns

mixed
The item or null if it's not found

Author

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

Returns all the cached items as an associative array

Returns all the cached items as an associative array

Returns

array

Author

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

Purges all cached items

Purges all cached items

Returns

boolean

Author

Art a.molcanovas@gmail.com
public boolean
# setKey( string $key, mixed $value, integer|DateTime $timeout = null )

Sets a cached item

Sets a cached item

Parameters

$key
Item key
$value
Item value
$timeout

Expiration time in seconds, or a DateTime object for when it's supposed to expire

Returns

boolean

Author

Art a.molcanovas@gmail.com
public integer
# getRemainingLifetime( string $key )

Returns how many seconds this key has left before expiring

Returns how many seconds this key has left before expiring

Parameters

$key
The key

Returns

integer
The remaining lifetime in seconds. If the key doesn't exist 0 is returned.

Author

Art a.molcanovas@gmail.com

Methods inherited from ArrayAccess

offsetExists(), offsetGet(), offsetSet(), offsetUnset()

Methods inherited from Countable

count()

Methods inherited from IteratorAggregate

getIterator()

AloFramework Cache 1.0 API API documentation generated by ApiGen