Skip to content

Commit

Permalink
Move to XML services and remove Yaml dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierstoval authored and Jean85 committed Sep 28, 2018
1 parent 062555a commit 7c76ba5
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 28 deletions.
3 changes: 1 addition & 2 deletions composer.json
Expand Up @@ -27,8 +27,7 @@
"symfony/dependency-injection": "^3.0||^4.0",
"symfony/event-dispatcher": "^3.0||^4.0",
"symfony/http-kernel": "^3.0||^4.0",
"symfony/security-core": "^3.0||^4.0",
"symfony/yaml": "^3.0||^4.0"
"symfony/security-core": "^3.0||^4.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.8",
Expand Down
4 changes: 2 additions & 2 deletions src/DependencyInjection/SentryExtension.php
Expand Up @@ -24,8 +24,8 @@ public function load(array $configs, ContainerBuilder $container)
{
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
$loader->load('services.yml');
$loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
$loader->load('services.xml');

foreach ($config as $key => $value) {
$container->setParameter('sentry.' . $key, $value);
Expand Down
30 changes: 30 additions & 0 deletions src/Resources/config/services.xml
@@ -0,0 +1,30 @@
<?xml version="1.0" ?>

<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

<services>
<service id="sentry.client" class="%sentry.client%" public="true">
<argument>%sentry.dsn%</argument>
<argument>%sentry.options%</argument>
<call method="install" />
</service>

<service id="%sentry.client%" alias="sentry.client" />

<service id="sentry.exception_listener" class="%sentry.exception_listener%">
<argument type="service" id="sentry.client" />
<argument type="service" id="event_dispatcher" />
<argument type="service" id="request_stack" />
<argument>%sentry.skip_capture%</argument>
<argument type="service" id="security.token_storage" on-invalid="ignore" />
<argument type="service" id="security.authorization_checker" on-invalid="ignore" />

<tag name="kernel.event_listener" event="kernel.request" method="onKernelRequest" priority="%sentry.listener_priorities.request%" />
<tag name="kernel.event_listener" event="kernel.exception" method="onKernelException" priority="%sentry.listener_priorities.kernel_exception%" />
<tag name="kernel.event_listener" event="console.command" method="onConsoleCommand" />
<tag name="kernel.event_listener" event="console.error" method="onConsoleError" priority="%sentry.listener_priorities.console_exception%" />
</service>
</services>
</container>
24 changes: 0 additions & 24 deletions src/Resources/config/services.yml

This file was deleted.

0 comments on commit 7c76ba5

Please sign in to comment.