forked from opensoftwareconsulting/rich-model-forms-bundle
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathKernel.php
More file actions
66 lines (56 loc) · 2.14 KB
/
Kernel.php
File metadata and controls
66 lines (56 loc) · 2.14 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
66
<?php
/*
* This file is part of the RichModelFormsBundle package.
*
* (c) Christian Flothmann <christian.flothmann@qossmic.com>
* (c) Christopher Hertel <mail@christopher-hertel.de>
* (c) QOSSMIC GmbH <info@qossmic.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types = 1);
namespace Qossmic\RichModelForms\Tests\Fixtures\DependencyInjection;
use Composer\InstalledVersions;
use Qossmic\RichModelForms\RichModelFormsBundle;
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Kernel as BaseKernel;
class Kernel extends BaseKernel
{
public function registerBundles(): array
{
return [
new FrameworkBundle(),
new RichModelFormsBundle(),
];
}
public function registerContainerConfiguration(LoaderInterface $loader): void
{
$loader->load(function (ContainerBuilder $container): void {
$frameworkConfig = [
'handle_all_throwables' => false,
'http_method_override' => false,
'php_errors' => [
'log' => false,
],
];
if (version_compare(InstalledVersions::getVersion('symfony/framework-bundle'), '7.3.0', '>=')) {
$frameworkConfig['property_info']['with_constructor_extractor'] = true;
}
$container->addCompilerPass(new PublicTestAliasPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION, 1000);
$container->setParameter('kernel.secret', __FILE__);
$container->loadFromExtension('framework', $frameworkConfig);
});
}
public function getCacheDir(): string
{
return \sprintf('%s/RichModelForms/%d/cache', sys_get_temp_dir(), self::VERSION_ID);
}
public function getLogDir(): string
{
return \sprintf('%s/RichModelForms/%d/log', sys_get_temp_dir(), self::VERSION_ID);
}
}