Refactor Cache/Lock to DICE

- Refactor Cache classes
- Refactor Lock classes
- Improved test speed (removed some seperate class annotations)
This commit is contained in:
Philipp Holzer 2019-08-03 20:48:56 +02:00
parent b95d4f41b9
commit d56bd28a07
No known key found for this signature in database
GPG key ID: D8365C3D36B77D90
40 changed files with 766 additions and 621 deletions

View file

@ -1,7 +1,6 @@
<?php
namespace Friendica\Core\Cache;
use Friendica\Core\Cache;
/**
* This interface defines methods for Memory-Caches only
@ -20,7 +19,7 @@ interface IMemoryCacheDriver extends ICacheDriver
* @param int $ttl The cache lifespan, must be one of the Cache constants
* @return bool
*/
public function add($key, $value, $ttl = Cache::FIVE_MINUTES);
public function add($key, $value, $ttl = ICacheDriver::FIVE_MINUTES);
/**
* Compares if the old value is set and sets the new value
@ -32,7 +31,7 @@ interface IMemoryCacheDriver extends ICacheDriver
*
* @return bool
*/
public function compareSet($key, $oldValue, $newValue, $ttl = Cache::FIVE_MINUTES);
public function compareSet($key, $oldValue, $newValue, $ttl = ICacheDriver::FIVE_MINUTES);
/**
* Compares if the old value is set and removes it