-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathElasticsearch.php
40 lines (33 loc) · 1.23 KB
/
Elasticsearch.php
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
<?php declare(strict_types=1);
namespace Shopware\Elasticsearch;
use Shopware\Core\Framework\Bundle;
use Shopware\Core\Framework\Log\Package;
use Shopware\Elasticsearch\DependencyInjection\ElasticsearchExtension;
use Shopware\Elasticsearch\DependencyInjection\ElasticsearchMigrationCompilerPass;
use Shopware\Elasticsearch\Profiler\ElasticsearchProfileCompilerPass;
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
/**
* @internal
*/
#[Package('framework')]
class Elasticsearch extends Bundle
{
public function getTemplatePriority(): int
{
return -1;
}
public function build(ContainerBuilder $container): void
{
parent::build($container);
$this->buildDefaultConfig($container);
$container->addCompilerPass(new ElasticsearchMigrationCompilerPass());
// Needs to run before the ProfilerPass
$container->addCompilerPass(new ElasticsearchProfileCompilerPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION, 5000);
}
protected function createContainerExtension(): ?ExtensionInterface
{
return new ElasticsearchExtension();
}
}