Esempio n. 1
0
 /**
  * Create the locale-service
  *
  * @param \Zend\ServiceManager\ServiceLocatorInterface $serviceLocator
  * @return \Zork\Cache\CacheManager
  */
 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     // Configure the locale
     $config = $serviceLocator->get('Configuration');
     $srvConfig = isset($config['cache']) ? $config['cache'] : array();
     return CacheManager::factory($srvConfig);
 }
Esempio n. 2
0
 /**
  * Test AbstractCacheStorage
  */
 public function testAbstractCacheStorage()
 {
     $manager = CacheManager::factory(array('storage' => array('adapter' => array('name' => 'memory'))));
     $abstractStorage = $this->getMockBuilder('Zork\\Cache\\AbstractCacheStorage')->setMethods(null)->setConstructorArgs(array($manager))->getMock();
     $this->assertInstanceOf('Zend\\Cache\\Storage\\StorageInterface', $abstractStorage->getCacheStorage());
 }
Esempio n. 3
0
 /**
  * @param \Zork\Cache\CacheManager $cacheManager
  * @param string $namespace
  */
 public function __construct(CacheManager $cacheManager, $namespace = null)
 {
     $this->setCacheStorage($cacheManager->createStorage($namespace ?: get_called_class()));
 }