X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FFactory%2FCacheFactory.php;h=1e93b5ee07d35f504d63961985bb841b8146fc20;hb=5d61599964e74bb733816a5592eee2aed3bbba4e;hp=afb799e01c328b0db085c4ca0edd14c0a3b69beb;hpb=34e4968c060d0860f72f1d0120751e6cf8513dcb;p=friendica.git diff --git a/src/Factory/CacheFactory.php b/src/Factory/CacheFactory.php index afb799e01c..1e93b5ee07 100644 --- a/src/Factory/CacheFactory.php +++ b/src/Factory/CacheFactory.php @@ -1,12 +1,31 @@ . + * + */ namespace Friendica\Factory; +use Friendica\App\BaseURL; use Friendica\Core\Cache; use Friendica\Core\Cache\ICache; -use Friendica\Core\Config\Configuration; +use Friendica\Core\Config\IConfig; use Friendica\Database\Database; -use Friendica\Util\BaseURL; use Friendica\Util\Profiler; use Psr\Log\LoggerInterface; @@ -22,10 +41,10 @@ class CacheFactory /** * @var string The default cache if nothing set */ - const DEFAULT_TYPE = Cache\AbstractCache::TYPE_DATABASE; + const DEFAULT_TYPE = Cache\Type::DATABASE; /** - * @var Configuration The configuration to read parameters out of the config + * @var IConfig The IConfiguration to read parameters out of the config */ private $config; @@ -49,7 +68,7 @@ class CacheFactory */ private $logger; - public function __construct(BaseURL $baseURL, Configuration $config, Database $dba, Profiler $profiler, LoggerInterface $logger) + public function __construct(BaseURL $baseURL, IConfig $config, Database $dba, Profiler $profiler, LoggerInterface $logger) { $this->hostname = $baseURL->getHostname(); $this->config = $config; @@ -73,16 +92,16 @@ class CacheFactory } switch ($type) { - case Cache\AbstractCache::TYPE_MEMCACHE: + case Cache\Type::MEMCACHE: $cache = new Cache\MemcacheCache($this->hostname, $this->config); break; - case Cache\AbstractCache::TYPE_MEMCACHED: + case Cache\Type::MEMCACHED: $cache = new Cache\MemcachedCache($this->hostname, $this->config, $this->logger); break; - case Cache\AbstractCache::TYPE_REDIS: + case Cache\Type::REDIS: $cache = new Cache\RedisCache($this->hostname, $this->config); break; - case Cache\AbstractCache::TYPE_APCU: + case Cache\Type::APCU: $cache = new Cache\APCuCache($this->hostname); break; default: