mirror of
https://github.com/friendica/friendica
synced 2025-04-23 01:10:11 +00:00
"Imported" name spaces (#5361)
* Fixes for #5355: - let's import SPL/extension classes and then just use them without name spaces like we do it with our own classes/interfaces, too. - need to add namespace \ (global) Signed-off-by: Roland Häder <roland@mxchange.org> * Removed leading slashes from "import" lines. Signed-off-by: Roland Häder <roland@mxchange.org> * Completed: - "import" other classes, then use them Signed-off-by: Roland Häder <roland@mxchange.org>
This commit is contained in:
parent
3792e2819d
commit
8825728fa4
3 changed files with 21 additions and 12 deletions
|
@ -4,6 +4,9 @@ namespace Friendica\Core\Cache;
|
|||
|
||||
use Friendica\Core\Cache;
|
||||
|
||||
use Exception;
|
||||
use Redis;
|
||||
|
||||
/**
|
||||
* Redis Cache Driver. This driver is based on Memcache driver
|
||||
*
|
||||
|
@ -13,20 +16,20 @@ use Friendica\Core\Cache;
|
|||
class RedisCacheDriver extends AbstractCacheDriver implements IMemoryCacheDriver
|
||||
{
|
||||
/**
|
||||
* @var \Redis
|
||||
* @var Redis
|
||||
*/
|
||||
private $redis;
|
||||
|
||||
public function __construct($redis_host, $redis_port)
|
||||
{
|
||||
if (!class_exists('Redis', false)) {
|
||||
throw new \Exception('Redis class isn\'t available');
|
||||
throw new Exception('Redis class isn\'t available');
|
||||
}
|
||||
|
||||
$this->redis = new \Redis();
|
||||
$this->redis = new Redis();
|
||||
|
||||
if (!$this->redis->connect($redis_host, $redis_port)) {
|
||||
throw new \Exception('Expected Redis server at ' . $redis_host . ':' . $redis_port . ' isn\'t available');
|
||||
throw new Exception('Expected Redis server at ' . $redis_host . ':' . $redis_port . ' isn\'t available');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue