File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
src/Dflydev/Pimple/Provider/DoctrineOrm Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 1414use Doctrine \Common \Cache \ApcCache ;
1515use Doctrine \Common \Cache \ArrayCache ;
1616use Doctrine \Common \Cache \CacheProvider ;
17+ use Doctrine \Common \Cache \FilesystemCache ;
1718use Doctrine \Common \Cache \MemcacheCache ;
1819use Doctrine \Common \Cache \MemcachedCache ;
1920use Doctrine \Common \Cache \XcacheCache ;
@@ -254,6 +255,13 @@ public function register(\Pimple $app)
254255 return new XcacheCache ;
255256 });
256257
258+ $ app ['orm.cache.factory.filesystem ' ] = $ app ->protect (function ($ cacheOptions ) {
259+ if (empty ($ cacheOptions ['path ' ])) {
260+ throw new \RuntimeException ('FilesystemCache path not defined ' );
261+ }
262+ return new FilesystemCache ($ cacheOptions ['path ' ]);
263+ });
264+
257265 $ app ['orm.cache.factory ' ] = $ app ->protect (function ($ driver , $ cacheOptions ) use ($ app ) {
258266 switch ($ driver ) {
259267 case 'array ' :
@@ -266,6 +274,8 @@ public function register(\Pimple $app)
266274 return $ app ['orm.cache.factory.memcache ' ]($ cacheOptions );
267275 case 'memcached ' :
268276 return $ app ['orm.cache.factory.memcached ' ]($ cacheOptions );
277+ case 'filesystem ' :
278+ return $ app ['orm.cache.factory.filesystem ' ]($ cacheOptions );
269279 default :
270280 throw new \RuntimeException ("Unsupported cache type ' $ driver' specified " );
271281 }
You can’t perform that action at this time.
0 commit comments