mirror of
https://github.com/friendica/friendica
synced 2025-04-29 13:04:23 +02:00
Rename *CacheDriver to *Cache because they don't act as driver anymore
This commit is contained in:
parent
d56bd28a07
commit
86bf2ee45a
38 changed files with 152 additions and 144 deletions
|
@ -3,13 +3,13 @@
|
|||
namespace Friendica\Core\Lock;
|
||||
|
||||
/**
|
||||
* Class AbstractLockDriver
|
||||
* Class AbstractLock
|
||||
*
|
||||
* @package Friendica\Core\Lock
|
||||
*
|
||||
* Basic class for Locking with common functions (local acquired locks, releaseAll, ..)
|
||||
*/
|
||||
abstract class AbstractLockDriver implements ILockDriver
|
||||
abstract class AbstractLock implements ILock
|
||||
{
|
||||
/**
|
||||
* @var array The local acquired locks
|
|
@ -3,21 +3,21 @@
|
|||
namespace Friendica\Core\Lock;
|
||||
|
||||
use Friendica\Core\Cache;
|
||||
use Friendica\Core\Cache\IMemoryCacheDriver;
|
||||
use Friendica\Core\Cache\IMemoryCache;
|
||||
|
||||
class CacheLockDriver extends AbstractLockDriver
|
||||
class CacheLockDriver extends AbstractLock
|
||||
{
|
||||
/**
|
||||
* @var \Friendica\Core\Cache\ICacheDriver;
|
||||
* @var \Friendica\Core\Cache\ICache;
|
||||
*/
|
||||
private $cache;
|
||||
|
||||
/**
|
||||
* CacheLockDriver constructor.
|
||||
*
|
||||
* @param IMemoryCacheDriver $cache The CacheDriver for this type of lock
|
||||
* @param IMemoryCache $cache The CacheDriver for this type of lock
|
||||
*/
|
||||
public function __construct(IMemoryCacheDriver $cache)
|
||||
public function __construct(IMemoryCache $cache)
|
||||
{
|
||||
$this->cache = $cache;
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ use Friendica\Util\DateTimeFormat;
|
|||
/**
|
||||
* Locking driver that stores the locks in the database
|
||||
*/
|
||||
class DatabaseLockDriver extends AbstractLockDriver
|
||||
class DatabaseLock extends AbstractLock
|
||||
{
|
||||
/**
|
||||
* The current ID of the process
|
|
@ -5,11 +5,11 @@ namespace Friendica\Core\Lock;
|
|||
use Friendica\Core\Cache;
|
||||
|
||||
/**
|
||||
* Lock Driver Interface
|
||||
* Lock Interface
|
||||
*
|
||||
* @author Philipp Holzer <admin@philipp.info>
|
||||
*/
|
||||
interface ILockDriver
|
||||
interface ILock
|
||||
{
|
||||
/**
|
||||
* Checks, if a key is currently locked to a or my process
|
||||
|
@ -30,7 +30,7 @@ interface ILockDriver
|
|||
*
|
||||
* @return boolean Was the lock successful?
|
||||
*/
|
||||
public function acquireLock($key, $timeout = 120, $ttl = Cache\ICacheDriver::FIVE_MINUTES);
|
||||
public function acquireLock($key, $timeout = 120, $ttl = Cache\ICache::FIVE_MINUTES);
|
||||
|
||||
/**
|
||||
* Releases a lock if it was set by us
|
|
@ -4,7 +4,7 @@ namespace Friendica\Core\Lock;
|
|||
|
||||
use Friendica\Core\Cache;
|
||||
|
||||
class SemaphoreLockDriver extends AbstractLockDriver
|
||||
class SemaphoreLock extends AbstractLock
|
||||
{
|
||||
private static $semaphore = [];
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue