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

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

Public Member Functions

 __construct (protected 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...
 

Public Attributes

const TABLE_NAME = 'hmac_cache'
 

Protected Attributes

int $ttl = 90000
 

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 ( protected Database  $database)

Create a new table handler.

Parameters
Database$databasethe Elgg database handler

Definition at line 34 of file HMACCacheTable.php.

Elgg\Database\HMACCacheTable::__destruct ( )

Cleanup expired HMAC keys.

Returns
void

Definition at line 42 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 124 of file HMACCacheTable.php.

Elgg\Database\HMACCacheTable::getTTL ( )

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

Returns
int

Definition at line 76 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 104 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
RangeException

Definition at line 63 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 87 of file HMACCacheTable.php.

Member Data Documentation

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

Definition at line 27 of file HMACCacheTable.php.

const Elgg\Database\HMACCacheTable::TABLE_NAME = 'hmac_cache'

Definition at line 22 of file HMACCacheTable.php.


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