-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIbexaSearchExtension.php
55 lines (49 loc) · 1.86 KB
/
IbexaSearchExtension.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
/**
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
declare(strict_types=1);
namespace Ibexa\Bundle\Search\DependencyInjection;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
class IbexaSearchExtension extends Extension implements PrependExtensionInterface
{
public function load(array $configs, ContainerBuilder $container)
{
$loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
$loader->load('services.yaml');
}
/**
* Allow an extension to prepend the extension configurations.
*
* @param \Symfony\Component\DependencyInjection\ContainerBuilder $container
*/
public function prepend(ContainerBuilder $container): void
{
$this->prependJMSTranslation($container);
}
/**
* @param \Symfony\Component\DependencyInjection\ContainerBuilder $container
*/
public function prependJMSTranslation(ContainerBuilder $container): void
{
$container->prependExtensionConfig('jms_translation', [
'configs' => [
'ibexa_search' => [
'dirs' => [
__DIR__ . '/../../',
],
'output_dir' => __DIR__ . '/../Resources/translations/',
'output_format' => 'xliff',
'excluded_names' => ['*.module.js'],
'excluded_dirs' => [],
'extractors' => [],
],
],
]);
}
}