Skip to content

Commit 329139f

Browse files
authored
Merge pull request #4 from tatarenkoigor/add-symfony-bundle-1.0.x
Add symfony bundle
2 parents 5cd34df + 27c7075 commit 329139f

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

src/JaegerBundle.php

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?php
2+
3+
namespace Jaeger\Symfony;
4+
5+
use Jaeger\Symfony\Resources\DependencyInjection\CodecRegistryCompilerPass;
6+
use Jaeger\Symfony\Resources\DependencyInjection\ContextExtractorChainCompilerPass;
7+
use Jaeger\Symfony\Resources\DependencyInjection\DebugExtractorChainCompilerPass;
8+
use Jaeger\Symfony\Resources\DependencyInjection\JaegerExtension;
9+
use Jaeger\Symfony\Resources\DependencyInjection\NameGeneratorChainCompilerPass;
10+
use Symfony\Component\DependencyInjection\ContainerBuilder;
11+
use Symfony\Component\HttpKernel\Bundle\Bundle;
12+
13+
class JaegerBundle extends Bundle
14+
{
15+
public function build(ContainerBuilder $container)
16+
{
17+
parent::build($container);
18+
19+
$container
20+
->addCompilerPass(new CodecRegistryCompilerPass())
21+
->addCompilerPass(new ContextExtractorChainCompilerPass())
22+
->addCompilerPass(new DebugExtractorChainCompilerPass())
23+
->addCompilerPass(new NameGeneratorChainCompilerPass());
24+
}
25+
26+
27+
public function getContainerExtension()
28+
{
29+
return new JaegerExtension();
30+
}
31+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
namespace Jaeger\Symfony\Resources\DependencyInjection;
4+
5+
use Symfony\Component\Config\FileLocator;
6+
use Symfony\Component\DependencyInjection\ContainerBuilder;
7+
use Symfony\Component\DependencyInjection\Extension\Extension;
8+
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
9+
10+
class JaegerExtension extends Extension
11+
{
12+
public function load(array $configs, ContainerBuilder $container)
13+
{
14+
$loader = new YamlFileLoader(
15+
$container,
16+
new FileLocator(__DIR__ . '/../config')
17+
);
18+
$loader->load('services.yml');
19+
}
20+
}

0 commit comments

Comments
 (0)