public function test_a_string_class_can_be_use_as_extend() { CacheManager::extend('custom3', StubCacheProvider::class); $driver = CacheManager::resolve('custom3'); $this->assertEquals('stub', $driver); }
/** * @return mixed */ public function getCache() { if (config('doctrine.cache.default')) { return CacheManager::resolve(config('doctrine.cache.default')); } }
/** * Register the meta data drivers */ protected function setupMetaData() { MetaDataManager::registerDrivers($this->app->config->get('doctrine.meta.drivers', []), $this->app->config->get('doctrine.dev', false)); MetaDataManager::resolved(function (Configuration $configuration) { // Debugbar if ($this->app->config->get('doctrine.debugbar', false) === true) { $debugStack = new DebugStack(); $configuration->setSQLLogger($debugStack); $this->app['debugbar']->addCollector(new DoctrineCollector($debugStack)); } // Automatically make table, column names, etc. like Laravel $configuration->setNamingStrategy($this->app->make(LaravelNamingStrategy::class)); // Custom functions $configuration->setCustomDatetimeFunctions($this->app->config->get('doctrine.custom_datetime_functions')); $configuration->setCustomNumericFunctions($this->app->config->get('doctrine.custom_numeric_functions')); $configuration->setCustomStringFunctions($this->app->config->get('doctrine.custom_string_functions')); // Second level caching if ($this->app->config->get('cache.second_level', false)) { $configuration->setSecondLevelCacheEnabled(true); $cacheConfig = $configuration->getSecondLevelCacheConfiguration(); $cacheConfig->setCacheFactory(new DefaultCacheFactory($cacheConfig->getRegionsConfiguration(), CacheManager::resolve($this->app->config->get('cache.default')))); } }); }