1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Overblog\GraphQLBundle; |
4
|
|
|
|
5
|
|
|
use Overblog\GraphQLBundle\DependencyInjection\Compiler\AliasedPass; |
6
|
|
|
use Overblog\GraphQLBundle\DependencyInjection\Compiler\AutoMappingPass; |
7
|
|
|
use Overblog\GraphQLBundle\DependencyInjection\Compiler\AutowiringTypesPass; |
8
|
|
|
use Overblog\GraphQLBundle\DependencyInjection\Compiler\ConfigTypesPass; |
9
|
|
|
use Overblog\GraphQLBundle\DependencyInjection\Compiler\DefinitionConfigProcessorPass; |
10
|
|
|
use Overblog\GraphQLBundle\DependencyInjection\Compiler\ExpressionFunctionPass; |
11
|
|
|
use Overblog\GraphQLBundle\DependencyInjection\Compiler\GlobalVariablesPass; |
12
|
|
|
use Overblog\GraphQLBundle\DependencyInjection\Compiler\MutationTaggedServiceMappingTaggedPass; |
13
|
|
|
use Overblog\GraphQLBundle\DependencyInjection\Compiler\ResolverTaggedServiceMappingPass; |
14
|
|
|
use Overblog\GraphQLBundle\DependencyInjection\Compiler\TypeTaggedServiceMappingPass; |
15
|
|
|
use Overblog\GraphQLBundle\DependencyInjection\OverblogGraphQLExtension; |
16
|
|
|
use Overblog\GraphQLBundle\DependencyInjection\OverblogGraphQLTypesExtension; |
17
|
|
|
use Symfony\Component\DependencyInjection\Compiler\PassConfig; |
18
|
|
|
use Symfony\Component\DependencyInjection\ContainerBuilder; |
19
|
|
|
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface; |
20
|
|
|
use Symfony\Component\HttpKernel\Bundle\Bundle; |
21
|
|
|
|
22
|
|
|
class OverblogGraphQLBundle extends Bundle |
23
|
|
|
{ |
24
|
117 |
|
public function boot() |
25
|
|
|
{ |
26
|
117 |
|
if ($this->container->has('overblog_graphql.cache_compiler')) { |
27
|
117 |
|
$this->container->get('overblog_graphql.cache_compiler')->loadClasses(); |
28
|
|
|
} |
29
|
117 |
|
} |
30
|
|
|
|
31
|
|
|
/** |
32
|
|
|
* {@inheritdoc} |
33
|
|
|
*/ |
34
|
31 |
|
public function build(ContainerBuilder $container) |
35
|
|
|
{ |
36
|
31 |
|
parent::build($container); |
37
|
|
|
|
38
|
|
|
//ConfigTypesPass and AutoMappingPass must be before TypeTaggedServiceMappingPass |
39
|
31 |
|
$container->addCompilerPass(new GlobalVariablesPass()); |
40
|
31 |
|
$container->addCompilerPass(new ExpressionFunctionPass()); |
41
|
31 |
|
$container->addCompilerPass(new DefinitionConfigProcessorPass()); |
42
|
31 |
|
$container->addCompilerPass(new AutoMappingPass()); |
43
|
31 |
|
$container->addCompilerPass(new AliasedPass()); |
44
|
31 |
|
$container->addCompilerPass(new AutowiringTypesPass()); |
45
|
|
|
|
46
|
31 |
|
$container->addCompilerPass(new ConfigTypesPass(), PassConfig::TYPE_BEFORE_REMOVING); |
47
|
31 |
|
$container->addCompilerPass(new TypeTaggedServiceMappingPass(), PassConfig::TYPE_BEFORE_REMOVING); |
48
|
31 |
|
$container->addCompilerPass(new ResolverTaggedServiceMappingPass(), PassConfig::TYPE_BEFORE_REMOVING); |
49
|
31 |
|
$container->addCompilerPass(new MutationTaggedServiceMappingTaggedPass(), PassConfig::TYPE_BEFORE_REMOVING); |
50
|
|
|
|
51
|
31 |
|
$container->registerExtension(new OverblogGraphQLTypesExtension()); |
52
|
31 |
|
} |
53
|
|
|
|
54
|
31 |
|
public function getContainerExtension() |
55
|
|
|
{ |
56
|
31 |
|
if (!$this->extension instanceof ExtensionInterface) { |
57
|
31 |
|
$this->extension = new OverblogGraphQLExtension(); |
58
|
|
|
} |
59
|
|
|
|
60
|
31 |
|
return $this->extension; |
61
|
|
|
} |
62
|
|
|
} |
63
|
|
|
|