Rename *CacheDriver to *Cache because they don't act as driver anymore

This commit is contained in:
Philipp Holzer 2019-08-04 10:26:53 +02:00
parent d56bd28a07
commit 86bf2ee45a
No known key found for this signature in database
GPG key ID: D8365C3D36B77D90
38 changed files with 152 additions and 144 deletions

View file

@ -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

View file

@ -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;
}

View file

@ -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

View file

@ -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

View file

@ -4,7 +4,7 @@ namespace Friendica\Core\Lock;
use Friendica\Core\Cache;
class SemaphoreLockDriver extends AbstractLockDriver
class SemaphoreLock extends AbstractLock
{
private static $semaphore = [];