Key objects - automatically generate hashed keys.
Example of usage
Generate new hashed key:
if ($oKeys)
echo $oKeys->getNewKey (false, 3600);
static getInstance()
Definition BxDolKey.php:62
Check if hashed key exists:
if ($oKeys && $oKeys->isKeyExists ($sKey))
echo 'key exists';
else
echo 'key is invalid';
◆ __construct()
BxDolKey::__construct |
( |
| ) |
|
|
protected |
◆ __clone()
Prevent cloning the instance
◆ getInstance()
static BxDolKey::getInstance |
( |
| ) |
|
|
static |
◆ getKeyData()
BxDolKey::getKeyData |
( |
| $sKey, |
|
|
| $sSalt = '' ) |
Get key data.
- Parameters
-
- Returns
- true if key exists or false if key is missing
◆ getNewKey()
BxDolKey::getNewKey |
( |
| $aData = false, |
|
|
| $iExpire = 604800, |
|
|
| $sSalt = '' ) |
Get new key.
- Parameters
-
$aData | - some data to associate with the key |
$iExpire | - number of seconds to generated key after, by default - 1 week |
- Returns
- newly generated key string
◆ getNewKeyNumeric()
BxDolKey::getNewKeyNumeric |
( |
| $aData = false, |
|
|
| $iExpire = 604800 ) |
Get new key (numeric).
- Parameters
-
$aData | - some data to associate with the key |
$iExpire | - number of seconds to generated key after, by default - 1 week |
- Returns
- newly generated key string
◆ isKeyExists()
BxDolKey::isKeyExists |
( |
| $sKey, |
|
|
| $sSalt = '' ) |
Check if provided key exists.
- Parameters
-
- Returns
- true if key exists or false if key is missing
◆ prune()
◆ removeKey()
BxDolKey::removeKey |
( |
| $sKey | ) |
|
Delete provided key.
- Parameters
-
- Returns
- true if key was successfully found and delete if false otherwise
The documentation for this class was generated from the following file: