예제 #1
0
 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;
 }
예제 #2
0
 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;
 }