mirror of
https://github.com/friendica/friendica
synced 2025-09-10 03:25:20 +02:00
Adding possibility to use a different cache-backend for locking and caching
- Renaming *LockDriver to *Lock since it isn't a "driver" anymore
This commit is contained in:
parent
86bf2ee45a
commit
34e4968c06
19 changed files with 149 additions and 64 deletions
|
@ -3,7 +3,7 @@
|
|||
namespace Friendica\Test\src\Core\Lock;
|
||||
|
||||
use Friendica\Core\Cache\APCuCache;
|
||||
use Friendica\Core\Lock\CacheLockDriver;
|
||||
use Friendica\Core\Lock\CacheLock;
|
||||
|
||||
class APCuCacheLockTest extends LockTest
|
||||
{
|
||||
|
@ -18,6 +18,6 @@ class APCuCacheLockTest extends LockTest
|
|||
|
||||
protected function getInstance()
|
||||
{
|
||||
return new CacheLockDriver(new APCuCache('localhost'));
|
||||
return new CacheLock(new APCuCache('localhost'));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,13 +3,13 @@
|
|||
namespace Friendica\Test\src\Core\Lock;
|
||||
|
||||
use Friendica\Core\Cache\ArrayCache;
|
||||
use Friendica\Core\Lock\CacheLockDriver;
|
||||
use Friendica\Core\Lock\CacheLock;
|
||||
|
||||
class ArrayCacheLockTest extends LockTest
|
||||
{
|
||||
protected function getInstance()
|
||||
{
|
||||
return new CacheLockDriver(new ArrayCache('localhost'));
|
||||
return new CacheLock(new ArrayCache('localhost'));
|
||||
}
|
||||
|
||||
public function testLockTTL()
|
||||
|
|
|
@ -5,7 +5,7 @@ namespace Friendica\Test\src\Core\Lock;
|
|||
|
||||
use Friendica\Core\Cache\MemcacheCache;
|
||||
use Friendica\Core\Config\Configuration;
|
||||
use Friendica\Core\Lock\CacheLockDriver;
|
||||
use Friendica\Core\Lock\CacheLock;
|
||||
|
||||
/**
|
||||
* @requires extension Memcache
|
||||
|
@ -25,6 +25,6 @@ class MemcacheCacheLockTest extends LockTest
|
|||
->with('system', 'memcache_port')
|
||||
->andReturn(11211);
|
||||
|
||||
return new CacheLockDriver(new MemcacheCache('localhost', $configMock));
|
||||
return new CacheLock(new MemcacheCache('localhost', $configMock));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ namespace Friendica\Test\src\Core\Lock;
|
|||
|
||||
use Friendica\Core\Cache\MemcachedCache;
|
||||
use Friendica\Core\Config\Configuration;
|
||||
use Friendica\Core\Lock\CacheLockDriver;
|
||||
use Friendica\Core\Lock\CacheLock;
|
||||
use Psr\Log\NullLogger;
|
||||
|
||||
/**
|
||||
|
@ -24,6 +24,6 @@ class MemcachedCacheLockTest extends LockTest
|
|||
|
||||
$logger = new NullLogger();
|
||||
|
||||
return new CacheLockDriver(new MemcachedCache('localhost', $configMock, $logger));
|
||||
return new CacheLock(new MemcachedCache('localhost', $configMock, $logger));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ namespace Friendica\Test\src\Core\Lock;
|
|||
|
||||
use Friendica\Core\Cache\RedisCache;
|
||||
use Friendica\Core\Config\Configuration;
|
||||
use Friendica\Core\Lock\CacheLockDriver;
|
||||
use Friendica\Core\Lock\CacheLock;
|
||||
|
||||
/**
|
||||
* @requires extension redis
|
||||
|
@ -34,6 +34,6 @@ class RedisCacheLockTest extends LockTest
|
|||
->with('system', 'redis_password')
|
||||
->andReturn(null);
|
||||
|
||||
return new CacheLockDriver(new RedisCache('localhost', $configMock));
|
||||
return new CacheLock(new RedisCache('localhost', $configMock));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue