Inheritance: extends AbstractBackend, implements Neos\Cache\Backend\TaggableBackendInterface, implements IterableBackendInterface, implements Neos\Cache\Backend\PhpCapableBackendInterface, use trait RequireOnceFromValueTrait
コード例 #1
0
 /**
  * Constructs this backend
  *
  * @param ApplicationContext $context Flow's application context
  * @param array $options Configuration options - depends on the actual backend
  */
 public function __construct(ApplicationContext $context, array $options = [])
 {
     $this->context = $context;
     $environmentConfiguration = $this->createEnvironmentConfiguration($context);
     parent::__construct($environmentConfiguration, $options);
 }
コード例 #2
0
 /**
  * Sets up the APC backend used for testing
  *
  * @return PdoBackend
  */
 protected function setUpBackend()
 {
     $mockCache = $this->getMockBuilder(\Neos\Cache\Frontend\FrontendInterface::class)->disableOriginalConstructor()->getMock();
     $mockCache->expects($this->any())->method('getIdentifier')->will($this->returnValue('TestCache'));
     $mockEnvironmentConfiguration = $this->getMockBuilder(\Neos\Cache\EnvironmentConfiguration::class)->setConstructorArgs([__DIR__ . '~Testing', 'vfs://Foo/', 255])->getMock();
     $backend = new PdoBackend($mockEnvironmentConfiguration);
     $backend->setCache($mockCache);
     $backend->setDataSourceName('sqlite::memory:');
     $backend->initializeObject();
     return $backend;
 }