Repository navigation
Expand file tree
/
Copy pathFopKernel.php
More file actions
65 lines (56 loc) · 2.27 KB
/
Copy pathFopKernel.php
File metadata and controls
65 lines (56 loc) · 2.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php declare(strict_types=1);
namespace Fop\HttpKernel;
use Symfony\Component\Config\Loader\DelegatingLoader;
use Symfony\Component\Config\Loader\GlobFileLoader;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\Config\Loader\LoaderResolver;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpKernel\Bundle\BundleInterface;
use Symfony\Component\HttpKernel\Config\FileLocator;
use Symfony\Component\HttpKernel\Kernel;
use Symplify\PackageBuilder\DependencyInjection\CompilerPass\AutoBindParametersCompilerPass;
use Symplify\PackageBuilder\DependencyInjection\CompilerPass\AutoReturnFactoryCompilerPass;
use Symplify\PackageBuilder\DependencyInjection\CompilerPass\AutowireArrayParameterCompilerPass;
use Symplify\PackageBuilder\Yaml\FileLoader\ParameterMergingYamlFileLoader;
final class FopKernel extends Kernel
{
public function registerContainerConfiguration(LoaderInterface $loader): void
{
$loader->load(__DIR__ . '/../../packages/*/config/config.yaml', 'glob');
$loader->load(__DIR__ . '/../../config/config.yaml');
}
public function getCacheDir(): string
{
return sys_get_temp_dir() . '/fop_cache';
}
public function getLogDir(): string
{
return sys_get_temp_dir() . '/fop_log';
}
/**
* @return BundleInterface[]
*/
public function registerBundles(): iterable
{
return [];
}
protected function build(ContainerBuilder $containerBuilder): void
{
$containerBuilder->addCompilerPass(new AutoReturnFactoryCompilerPass());
$containerBuilder->addCompilerPass(new AutowireArrayParameterCompilerPass());
$containerBuilder->addCompilerPass(new AutoBindParametersCompilerPass());
}
/**
* @param ContainerInterface|ContainerBuilder $container
*/
protected function getContainerLoader(ContainerInterface $container): DelegatingLoader
{
$kernelFileLocator = new FileLocator($this);
$loaderResolver = new LoaderResolver([
new GlobFileLoader($kernelFileLocator),
new ParameterMergingYamlFileLoader($container, $kernelFileLocator),
]);
return new DelegatingLoader($loaderResolver);
}
}