diff --git a/config/doctrine.php b/config/doctrine.php index 0b52cc2c..696930a6 100644 --- a/config/doctrine.php +++ b/config/doctrine.php @@ -156,7 +156,7 @@ | Configure meta-data, query and result caching here. | Optionally you can enable second level caching. | - | Available: apc|array|file|memcached|redis|void + | Available: apc|array|file|memcached|php_file|redis|void | */ 'cache' => [ diff --git a/src/Configuration/Cache/PhpFileCacheProvider.php b/src/Configuration/Cache/PhpFileCacheProvider.php new file mode 100644 index 00000000..0edc6584 --- /dev/null +++ b/src/Configuration/Cache/PhpFileCacheProvider.php @@ -0,0 +1,36 @@ +config = $config; + } + + /** + * @param array $settings + * + * @return PhpFileCache + */ + public function resolve(array $settings = []) + { + return new PhpFileCache( + $this->config->get('cache.stores.file.path', storage_path('framework/cache')) + ); + } +} diff --git a/tests/Configuration/Cache/PhpFileCacheProviderTest.php b/tests/Configuration/Cache/PhpFileCacheProviderTest.php new file mode 100644 index 00000000..ca3b2904 --- /dev/null +++ b/tests/Configuration/Cache/PhpFileCacheProviderTest.php @@ -0,0 +1,27 @@ +shouldReceive('get') + ->with('cache.stores.file.path', __DIR__ . DIRECTORY_SEPARATOR . '../../Stubs/storage/framework/cache') + ->once() + ->andReturn('/tmp'); + + return new PhpFileCacheProvider( + $config + ); + } + + public function getExpectedInstance() + { + return PhpFileCache::class; + } +}