Hello,
A quick question if anyone tried to use Phpfastcache & php-di? I decided speed-up the overall Slim-based application performance added to my container definitions file following lines:
return [
GuzzleClient::class => function (ContainerInterface $container) {
$c = $container->get(Configuration::class);
$optGuzzle = array();
if ($c->findString('guzzle.cert') && !empty($c->getString('guzzle.cert'))) {
$optGuzzle['verify'] = $c->getString('app.basePath') . $c->getString('guzzle.cert');
}
if ($c->findArray('guzzle.proxy') && !empty($c->getArray('guzzle.proxy'))) {
$optGuzzle['proxy'] = $c->getArray('guzzle.proxy');
}
return new GuzzleClient($optGuzzle);
},
\Phpfastcache\CacheManager::class => function (ContainerInterface $container) {
return \Phpfastcache\CacheManager::getInstance('Files', new \Phpfastcache\Config\ConfigurationOption(['path' => 'c:/jwk/cache',]));
},
]
I’m using a pretty standard pattern, but for some reason the code above always fail with an error :
Fatal error: Class Phpfastcache\CacheManager contains 9 abstract methods and must therefore be declared abstract or implement the remaining methods (Psr\Cache\CacheItemPoolInterface::getItem, Psr\Cache\CacheItemPoolInterface::getItems, Psr\Cache\CacheItemPoolInterface::hasItem, …) in
C:_ng\geonosis\nginx-php-fpm-aws\src\vendor\phpfastcache\phpfastcache\lib\Phpfastcache\CacheManager.php on line 35
CacheManager class itself doesn’t have any abstract methods … Any ideas how to get it containerized in a proper way?