|
3 | 3 |
|
4 | 4 | namespace TheCodingMachine\Graphqlite\Bundle\DependencyInjection; |
5 | 5 |
|
| 6 | +use Doctrine\Common\Annotations\PsrCachedReader; |
6 | 7 | use GraphQL\Server\ServerConfig; |
7 | 8 | use GraphQL\Validator\Rules\DisableIntrospection; |
8 | 9 | use GraphQL\Validator\Rules\QueryComplexity; |
|
11 | 12 | use Symfony\Component\Cache\Adapter\ApcuAdapter; |
12 | 13 | use Symfony\Component\Cache\Adapter\PhpFilesAdapter; |
13 | 14 | use Symfony\Component\Cache\Psr16Cache; |
14 | | -use TheCodingMachine\GraphQLite\Mappers\StaticClassListTypeMapper; |
15 | 15 | use TheCodingMachine\GraphQLite\Mappers\StaticClassListTypeMapperFactory; |
16 | 16 | use Webmozart\Assert\Assert; |
17 | 17 | use function class_exists; |
18 | | -use Doctrine\Common\Annotations\AnnotationException; |
19 | 18 | use Doctrine\Common\Annotations\AnnotationReader as DoctrineAnnotationReader; |
20 | 19 | use Doctrine\Common\Annotations\AnnotationRegistry; |
21 | | -use Doctrine\Common\Annotations\CachedReader; |
22 | | -use Doctrine\Common\Cache\ApcuCache; |
23 | | -use function error_log; |
24 | 20 | use Mouf\Composer\ClassNameMapper; |
25 | 21 | use Psr\SimpleCache\CacheInterface; |
26 | 22 | use ReflectionParameter; |
27 | | -use Symfony\Component\Cache\Simple\ApcuCache as SymfonyApcuCache; |
28 | | -use Symfony\Component\Cache\Simple\PhpFilesCache as SymfonyPhpFilesCache; |
29 | 23 | use function filter_var; |
30 | 24 | use function function_exists; |
31 | | -use GraphQL\Type\Definition\InputObjectType; |
32 | | -use GraphQL\Type\Definition\ObjectType; |
33 | | -use Psr\Container\ContainerInterface; |
34 | 25 | use ReflectionClass; |
35 | 26 | use ReflectionMethod; |
36 | 27 | use function ini_get; |
37 | 28 | use function interface_exists; |
38 | | -use function php_sapi_name; |
39 | | -use function str_replace; |
40 | 29 | use function strpos; |
41 | 30 | use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; |
42 | 31 | use Symfony\Component\DependencyInjection\ContainerBuilder; |
43 | 32 | use Symfony\Component\DependencyInjection\Definition; |
44 | 33 | use Symfony\Component\DependencyInjection\Reference; |
45 | | -use Symfony\Component\EventDispatcher\EventDispatcherInterface; |
46 | 34 | use Symfony\Component\HttpFoundation\Session\SessionInterface; |
47 | 35 | use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; |
48 | 36 | use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface; |
49 | 37 | use Symfony\Component\Security\Core\User\UserInterface; |
50 | | -use Symfony\Component\Security\Core\User\UserProviderInterface; |
51 | 38 | use TheCodingMachine\CacheUtils\ClassBoundCache; |
52 | 39 | use TheCodingMachine\CacheUtils\ClassBoundCacheContract; |
53 | 40 | use TheCodingMachine\CacheUtils\ClassBoundCacheContractInterface; |
|
56 | 43 | use TheCodingMachine\ClassExplorer\Glob\GlobClassExplorer; |
57 | 44 | use TheCodingMachine\GraphQLite\AggregateControllerQueryProviderFactory; |
58 | 45 | use TheCodingMachine\GraphQLite\AnnotationReader; |
59 | | -use TheCodingMachine\GraphQLite\Annotations\AbstractRequest; |
60 | 46 | use TheCodingMachine\GraphQLite\Annotations\Autowire; |
61 | 47 | use TheCodingMachine\GraphQLite\Annotations\Field; |
62 | 48 | use TheCodingMachine\GraphQLite\Annotations\Mutation; |
63 | | -use TheCodingMachine\GraphQLite\Annotations\Parameter; |
64 | 49 | use TheCodingMachine\GraphQLite\Annotations\Query; |
65 | 50 | use TheCodingMachine\Graphqlite\Bundle\Controller\GraphQL\LoginController; |
66 | 51 | use TheCodingMachine\Graphqlite\Bundle\Controller\GraphQL\MeController; |
67 | | -use TheCodingMachine\GraphQLite\FieldsBuilder; |
68 | | -use TheCodingMachine\GraphQLite\FieldsBuilderFactory; |
69 | 52 | use TheCodingMachine\GraphQLite\GraphQLRuntimeException as GraphQLException; |
70 | | -use TheCodingMachine\GraphQLite\InputTypeGenerator; |
71 | | -use TheCodingMachine\GraphQLite\InputTypeUtils; |
72 | | -use TheCodingMachine\GraphQLite\Mappers\CompositeTypeMapper; |
73 | | -use TheCodingMachine\GraphQLite\Mappers\GlobTypeMapper; |
74 | | -use TheCodingMachine\GraphQLite\Mappers\RecursiveTypeMapperInterface; |
75 | | -use TheCodingMachine\GraphQLite\Mappers\Root\CompositeRootTypeMapper; |
76 | 53 | use TheCodingMachine\GraphQLite\Mappers\StaticTypeMapper; |
77 | | -use TheCodingMachine\GraphQLite\NamingStrategy; |
78 | 54 | use TheCodingMachine\GraphQLite\SchemaFactory; |
79 | | -use TheCodingMachine\GraphQLite\TypeGenerator; |
80 | | -use TheCodingMachine\GraphQLite\Types\MutableObjectType; |
81 | | -use TheCodingMachine\GraphQLite\Types\ResolvableInputObjectType; |
82 | | -use function var_dump; |
83 | 55 | use TheCodingMachine\Graphqlite\Bundle\Types\SymfonyUserInterfaceType; |
84 | 56 |
|
85 | 57 | /** |
@@ -441,10 +413,11 @@ private function getAnnotationReader(): AnnotationReader |
441 | 413 | { |
442 | 414 | if ($this->annotationReader === null) { |
443 | 415 | AnnotationRegistry::registerLoader('class_exists'); |
| 416 | + |
444 | 417 | $doctrineAnnotationReader = new DoctrineAnnotationReader(); |
445 | 418 |
|
446 | 419 | if (function_exists('apcu_fetch')) { |
447 | | - $doctrineAnnotationReader = new CachedReader($doctrineAnnotationReader, new ApcuCache(), true); |
| 420 | + $doctrineAnnotationReader = new PsrCachedReader($doctrineAnnotationReader, new ApcuAdapter('graphqlite'), true); |
448 | 421 | } |
449 | 422 |
|
450 | 423 | $this->annotationReader = new AnnotationReader($doctrineAnnotationReader, AnnotationReader::LAX_MODE); |
|
0 commit comments