public function test_can_replace_an_existing_driver() { $this->manager->extend('memcache', function () { return 'provider'; }); $this->assertEquals('provider', $this->manager->driver('memcache')); }
/** * @param Configuration $configuration */ protected function setSecondLevelCaching(Configuration $configuration) { if ($this->config->get('doctrine.cache.second_level', false)) { $configuration->setSecondLevelCacheEnabled(true); $cacheConfig = $configuration->getSecondLevelCacheConfiguration(); $cacheConfig->setCacheFactory(new DefaultCacheFactory($cacheConfig->getRegionsConfiguration(), $this->cache->driver())); } }
/** * @return mixed */ public function getCache() { if (config('doctrine.cache.default')) { return CacheManager::resolve(config('doctrine.cache.default')); } }
public function test_a_string_class_can_be_use_as_extend() { CacheManager::extend('custom3', StubCacheProvider::class); $driver = CacheManager::resolve('custom3'); $this->assertEquals('stub', $driver); }
protected function mockConnection() { $this->connection = m::mock(ConnectionManager::class); $this->connection->shouldReceive('driver')->once()->with('mysql', ['driver' => 'mysql'])->andReturn(['driver' => 'pdo_mysql']); }
/** * @param array $settings * * @return \Doctrine\ORM\Configuration|mixed */ public function resolve(array $settings = []) { $configuration = Setup::createConfiguration(array_get($settings, 'dev'), array_get($settings, 'proxies.path'), $this->cache->driver()); $configuration->setMetadataDriverImpl(new ConfigDriver($this->config->get(array_get($settings, 'mapping_file'), []))); return $configuration; }
/** * Register the cache drivers */ protected function setupCache() { CacheManager::registerDrivers($this->app->config->get('cache.stores', [])); }