1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-18 19:01:40 +02:00

refactor(core): cache drivers

This commit is contained in:
Awilum
2019-12-26 00:51:39 +03:00
parent 87c862acad
commit c4763790e7
10 changed files with 23 additions and 5 deletions

View File

@@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace Flextype\Cache;
use Psr\Container\ContainerInterface;
@@ -9,7 +11,7 @@ class AcpuAdapter implements CacheAdapterInterface
{
function __construct(ContainerInterface $flextype)
{
$this->flextype = $flextype;
$this->flextype = $flextype;
}
public function getDriver() : object

View File

@@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace Flextype\Cache;
use Doctrine\Common\Cache\ArrayCache;

View File

@@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace Flextype\Cache;
use Psr\Container\ContainerInterface;
@@ -8,7 +10,7 @@ interface CacheAdapterInterface
{
/**
* Injects the dependency container
*
*
* @param \Psr\Container\ContainerInterface $container
* @return void
*/
@@ -16,7 +18,7 @@ interface CacheAdapterInterface
/**
* Returns the cache driver object
*
*
* @return object
*/
public function getDriver() : object;

View File

@@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace Flextype\Cache;
use Doctrine\Common\Cache\FilesystemCache;

View File

@@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace Flextype\Cache;
use Doctrine\Common\Cache\MemcachedCache;
@@ -20,7 +22,7 @@ class MemcachedAdapter implements CacheAdapterInterface
$this->flextype['registry']->get('settings.cache.memcached.server', 'localhost'),
$this->flextype['registry']->get('settings.cache.memcache.port', 11211)
);
$driver = new MemcachedCache();
$driver->setMemcached($memcached);

View File

@@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace Flextype\Cache;
use Psr\Container\ContainerInterface;

View File

@@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace Flextype\Cache;
use Flextype\Component\Filesystem\Filesystem;

View File

@@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace Flextype\Cache;
use Doctrine\Common\Cache\WinCacheCache;

View File

@@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace Flextype\Cache;
use Doctrine\Common\Cache\ZendDataCache;

View File

@@ -121,7 +121,7 @@ $flextype['cache_adapter'] = static function ($container) use ($flextype) {
$driver_name = 'filesystem';
}
}
$class = ucfirst($driver_name);
$adapter = "Flextype\\Cache\\{$class}Adapter";