File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 1414use Psr \Cache \InvalidArgumentException ;
1515use Symfony \Component \Cache \Adapter \AdapterInterface ;
1616use Symfony \Component \Cache \Adapter \FilesystemAdapter ;
17+ use Symfony \Component \Cache \Adapter \FilesystemTagAwareAdapter ;
1718use Symfony \Component \Cache \Adapter \TagAwareAdapter ;
1819use Symfony \Component \Cache \Adapter \TagAwareAdapterInterface ;
1920use Symfony \Component \Cache \PruneableInterface ;
@@ -122,6 +123,11 @@ public function __construct(array $options = [])
122123 throw new MissingOptionsException ('The cache_directory option is required unless you set the cache explicitly ' );
123124 }
124125
126+ // As of Symfony 4.3+ we can use the optimized FilesystemTagAwareAdapter
127+ if (class_exists (FilesystemTagAwareAdapter::class)) {
128+ return new FilesystemTagAwareAdapter ('' , 0 , $ options ['cache_directory ' ]);
129+ }
130+
125131 return new TagAwareAdapter (
126132 new FilesystemAdapter ('' , 0 , $ options ['cache_directory ' ])
127133 );
You can’t perform that action at this time.
0 commit comments