public static function getService(ArrayObject $config, Loops $loops) { $cache = parent::getService($config, $loops); $classname = get_class($cache); if ($classname == 'Doctrine\\Common\\Cache\\RedisCache') { $cache->setRedis($loops->createService('redis', static::getConfig($loops, $config))); } return $cache; }
public static function getService(ArrayObject $config, Loops $loops) { $plugin = parent::getService($config, $loops); $plugin->start(0); register_shutdown_function(function () use($plugin) { if ($plugin->isStarted()) { $plugin->destroy(); } }); return $plugin; }