use Asika\SimpleConsole\CommandArgsException;
use Friendica\App;
+use Friendica\Core\Cache\Cache as CacheClass;
use Friendica\Core\Cache\ICache;
use RuntimeException;
if (count($this->args) >= 3) {
$key = $this->getArgument(1);
$value = $this->getArgument(2);
- $duration = intval($this->getArgument(3, ICache::FIVE_MINUTES));
+ $duration = intval($this->getArgument(3, CacheClass::FIVE_MINUTES));
if (is_array($this->cache->get($key))) {
throw new RuntimeException("$key is an array and can't be set using this command.");
* @param int $ttl The cache lifespan, must be one of the Cache constants
* @return bool
*/
- public function add($key, $value, $ttl = ICache::FIVE_MINUTES);
+ public function add($key, $value, $ttl = Cache::FIVE_MINUTES);
/**
* Compares if the old value is set and sets the new value
*
* @return bool
*/
- public function compareSet($key, $oldValue, $newValue, $ttl = ICache::FIVE_MINUTES);
+ public function compareSet($key, $oldValue, $newValue, $ttl = Cache::FIVE_MINUTES);
/**
* Compares if the old value is set and removes it
namespace Friendica\Core;
use Friendica\BaseObject;
-use Friendica\Core\Cache\ICache;
+use Friendica\Core\Cache\Cache;
use Friendica\Core\Lock\ILock;
/**
* @return boolean Was the lock successful?
* @throws \Exception
*/
- public static function acquire($key, $timeout = 120, $ttl = ICache::FIVE_MINUTES)
+ public static function acquire($key, $timeout = 120, $ttl = Cache::FIVE_MINUTES)
{
return self::getClass(ILock::class)->acquireLock($key, $timeout, $ttl);
}
*
* @return boolean Was the lock successful?
*/
- public function acquireLock($key, $timeout = 120, $ttl = Cache\ICache::FIVE_MINUTES);
+ public function acquireLock($key, $timeout = 120, $ttl = Cache\Cache::FIVE_MINUTES);
/**
* Releases a lock if it was set by us