Пример #1
0
 /**
  * @return ApcCache
  */
 public function getCache()
 {
     $cache = new ApcCache('http://localhost', 'prefix_', array());
     // force to clear the current apc instance (ie, ignore the servers informations)
     $cache->setCurrentOnly(true);
     return $cache;
 }
Пример #2
0
 /**
  * Constructor
  *
  * @param RouterInterface $router  A router instance
  * @param string          $token   A token to clear the related cache
  * @param string          $prefix  A prefix to avoid clash between instances
  * @param array           $servers An array of servers
  */
 public function __construct(RouterInterface $router, $token, $prefix, array $servers)
 {
     parent::__construct(null, $prefix, $servers);
     $this->router = $router;
     $this->token = $token;
 }