File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -86,6 +86,8 @@ class SchemaFactory
8686 private $ parameterMiddlewares = [];
8787 /** @var Reader */
8888 private $ doctrineAnnotationReader ;
89+ /** @var string */
90+ private $ annotationCacheDir ;
8991 /** @var AuthenticationServiceInterface|null */
9092 private $ authenticationService ;
9193 /** @var AuthorizationServiceInterface|null */
@@ -203,6 +205,13 @@ public function setDoctrineAnnotationReader(Reader $annotationReader): self
203205 return $ this ;
204206 }
205207
208+ public function setAnnotationCacheDir (string $ cacheDir ): self
209+ {
210+ $ this ->annotationCacheDir = $ cacheDir ;
211+
212+ return $ this ;
213+ }
214+
206215 /**
207216 * Returns a cached Doctrine annotation reader.
208217 * Note: we cannot get the annotation reader service in the container as we are in a compiler pass.
@@ -213,7 +222,8 @@ private function getDoctrineAnnotationReader(): Reader
213222 AnnotationRegistry::registerLoader ('class_exists ' );
214223 $ doctrineAnnotationReader = new DoctrineAnnotationReader ();
215224
216- $ cache = function_exists ('apcu_fetch ' ) ? new ApcuCache () : new PhpFileCache (sys_get_temp_dir () . '/graphqlite. ' . crc32 (__DIR__ ));
225+ $ cacheDir = $ this ->annotationCacheDir ?? sys_get_temp_dir ();
226+ $ cache = function_exists ('apcu_fetch ' ) ? new ApcuCache () : new PhpFileCache ($ cacheDir . '/graphqlite. ' . crc32 (__DIR__ ));
217227
218228 $ cache ->setNamespace ($ this ->cacheNamespace );
219229
You can’t perform that action at this time.
0 commit comments