Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move to XML services and remove Yaml dependency #155

Merged
merged 1 commit into from Sep 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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" />
Jean85 marked this conversation as resolved.
Show resolved Hide resolved

<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.