Elgg  Version 4.x
Public Member Functions | Protected Attributes | List of all members
Elgg\Database\HMACCacheTable Class Reference

Manage the contents of the hmac_cache table. More...

Public Member Functions

 __construct (Database $database)
 Create a new table handler. More...
 
 __destruct ()
 Cleanup expired HMAC keys. More...
 
 setTTL (int $ttl=0)
 Set the Time-To-Live of HMAC keys. More...
 
 getTTL ()
 Get the configured Time-To-Live of the HMAC keys. More...
 
 storeHMAC (string $hmac)
 Store a HMAC key for later use. More...
 
 loadHMAC (string $hmac)
 Load a HMAC key from the database. More...
 
 deleteHMAC (string $hmac)
 Delete a HMAC key from the database. More...
 

Protected Attributes

 $database
 
 $ttl = 90000
 
 $table = 'hmac_cache'
 

Detailed Description

Manage the contents of the hmac_cache table.

Since
4.0

Definition at line 15 of file HMACCacheTable.php.

Constructor & Destructor Documentation

Elgg\Database\HMACCacheTable::__construct ( Database  $database)

Create a new table handler.

Parameters
Database$databasethe Elgg database handler
Returns
void

Definition at line 41 of file HMACCacheTable.php.

Elgg\Database\HMACCacheTable::__destruct ( )

Cleanup expired HMAC keys.

Returns
void

Definition at line 50 of file HMACCacheTable.php.

Member Function Documentation

Elgg\Database\HMACCacheTable::deleteHMAC ( string  $hmac)

Delete a HMAC key from the database.

Parameters
string$hmacthe HMAC key
Returns
int

Definition at line 132 of file HMACCacheTable.php.

Elgg\Database\HMACCacheTable::getTTL ( )

Get the configured Time-To-Live of the HMAC keys.

Returns
int

Definition at line 84 of file HMACCacheTable.php.

Elgg\Database\HMACCacheTable::loadHMAC ( string  $hmac)

Load a HMAC key from the database.

Parameters
string$hmacthe HMAC key
Returns
string|null

Definition at line 112 of file HMACCacheTable.php.

Elgg\Database\HMACCacheTable::setTTL ( int  $ttl = 0)

Set the Time-To-Live of HMAC keys.

Parameters
int$ttlthe max TTL of the HMAC keys in seconds (-1 is endless)
Returns
void
Exceptions
InvalidArgumentException

Definition at line 71 of file HMACCacheTable.php.

Elgg\Database\HMACCacheTable::storeHMAC ( string  $hmac)

Store a HMAC key for later use.

Parameters
string$hmacthe HMAC key
Returns
int|false

Definition at line 95 of file HMACCacheTable.php.

Member Data Documentation

Elgg\Database\HMACCacheTable::$database
protected

Definition at line 22 of file HMACCacheTable.php.

Elgg\Database\HMACCacheTable::$table = 'hmac_cache'
protected

Definition at line 32 of file HMACCacheTable.php.

Elgg\Database\HMACCacheTable::$ttl = 90000
protected

Definition at line 27 of file HMACCacheTable.php.


The documentation for this class was generated from the following file: