mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Added cache locker
This commit is contained in:
parent
723e0afa4e
commit
ebce312d1a
2 changed files with 58 additions and 5 deletions
|
|
@ -65,6 +65,36 @@ class CacheClient
|
|||
return $this->Set($sKey.'/TIMER', time());
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sKey
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function SetLock($sKey)
|
||||
{
|
||||
return $this->Set($sKey.'/LOCK', '1');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sKey
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function RemoveLock($sKey)
|
||||
{
|
||||
return $this->Set($sKey.'/LOCK', '0');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sKey
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function GetLock($sKey)
|
||||
{
|
||||
return '1' === $this->Get($sKey.'/LOCK');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sKey
|
||||
* @param string $bClearAfterGet = false
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue