Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 11 additions & 15 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,19 @@ jobs:
matrix:
include:
# Lowest Deps
- php: 8.2
symfony-require: 5.4.*
composer-flags: '--prefer-stable --prefer-lowest'
# LTS with latest stable PHP
- php: 8.2
symfony-require: 6.4.*
composer-flags: '--prefer-stable'
# Active release
- php: 8.3
symfony-require: 7.1.*
symfony-version: 7.1.*
composer-flags: '--prefer-stable --ignore-platform-req=php+'
# Active release
- php: 8.4
symfony-version: 7.1.*
composer-flags: '--prefer-stable --ignore-platform-req=php+'
- php: 8.4
symfony-version: 7.2.*
composer-flags: '--prefer-stable --ignore-platform-req=php+'
- php: 8.4
symfony-version: 7.3.*
composer-flags: '--prefer-stable --ignore-platform-req=php+'
# Development release
- php: nightly
symfony-require: 7.1.*@dev
composer-flags: '--ignore-platform-req=php+'
stability: dev
can-fail: true
fail-fast: false

steps:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
/composer.lock
/vendor
/tools/**/vendor
/.claude/
16 changes: 8 additions & 8 deletions src/DependencyInjection/TiimeNewRelicExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ public function load(array $configs, ContainerBuilder $container): void
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);

$loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('services.xml');
$loader = new Loader\PhpFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('services.php');

$container->setAlias(NewRelicInteractorInterface::class, $this->getInteractorServiceId($config))->setPublic(false);
$container->setAlias(TransactionNamingStrategyInterface::class, $this->getTransactionNamingServiceId($config))->setPublic(false);
Expand Down Expand Up @@ -78,7 +78,7 @@ public function load(array $configs, ContainerBuilder $container): void
);

if ($config['http']['enabled']) {
$loader->load('http_listener.xml');
$loader->load('http_listener.php');
$container->getDefinition(RequestListener::class)
->setArguments(
[
Expand All @@ -98,7 +98,7 @@ public function load(array $configs, ContainerBuilder $container): void
}

if ($config['commands']['enabled']) {
$loader->load('command_listener.xml');
$loader->load('command_listener.php');
$container->getDefinition(CommandListener::class)
->setArguments(
[
Expand All @@ -108,22 +108,22 @@ public function load(array $configs, ContainerBuilder $container): void
}

if ($config['exceptions']['enabled']) {
$loader->load('exception_listener.xml');
$loader->load('exception_listener.php');
}

if ($config['deprecations']['enabled']) {
$loader->load('deprecation_listener.xml');
$loader->load('deprecation_listener.php');
}

if ($config['twig']) {
$loader->load('twig.xml');
$loader->load('twig.php');
}

if ($config['enabled'] && $config['monolog']['enabled']) {
if (!class_exists(\Monolog\Handler\NewRelicHandler::class)) {
throw new \LogicException('The "symfony/monolog-bundle" package must be installed in order to use "monolog" option.');
}
$loader->load('monolog.xml');
$loader->load('monolog.php');
$container->setParameter('tiime.new_relic.monolog', $config['monolog'] ?? []);
$container->setParameter('tiime.new_relic.application_name', $config['application_name']);
$container->setAlias('tiime.new_relic.logs_handler', $config['monolog']['service'])->setPublic(false);
Expand Down
24 changes: 24 additions & 0 deletions src/Resources/config/command_listener.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

declare(strict_types=1);

/*
* This file is part of Tiime New Relic bundle.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Tiime\NewRelicBundle\Listener\CommandListener;

return static function (ContainerConfigurator $container): void {
$services = $container->services()
->defaults()
->autowire()
->autoconfigure()
->private()
;

$services->set(CommandListener::class);
};
12 changes: 0 additions & 12 deletions src/Resources/config/command_listener.xml

This file was deleted.

26 changes: 26 additions & 0 deletions src/Resources/config/deprecation_listener.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

declare(strict_types=1);

/*
* This file is part of Tiime New Relic bundle.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Tiime\NewRelicBundle\Listener\DeprecationListener;

return static function (ContainerConfigurator $container): void {
$services = $container->services()
->defaults()
->autowire()
->autoconfigure()
->private()
;

$services->set(DeprecationListener::class)
->public()
;
};
12 changes: 0 additions & 12 deletions src/Resources/config/deprecation_listener.xml

This file was deleted.

24 changes: 24 additions & 0 deletions src/Resources/config/exception_listener.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

declare(strict_types=1);

/*
* This file is part of Tiime New Relic bundle.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Tiime\NewRelicBundle\Listener\ExceptionListener;

return static function (ContainerConfigurator $container): void {
$services = $container->services()
->defaults()
->autowire()
->autoconfigure()
->private()
;

$services->set(ExceptionListener::class);
};
12 changes: 0 additions & 12 deletions src/Resources/config/exception_listener.xml

This file was deleted.

26 changes: 26 additions & 0 deletions src/Resources/config/http_listener.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

declare(strict_types=1);

/*
* This file is part of Tiime New Relic bundle.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Tiime\NewRelicBundle\Listener\RequestListener;
use Tiime\NewRelicBundle\Listener\ResponseListener;

return static function (ContainerConfigurator $container): void {
$services = $container->services()
->defaults()
->autowire()
->autoconfigure()
->private()
;

$services->set(RequestListener::class);
$services->set(ResponseListener::class);
};
13 changes: 0 additions & 13 deletions src/Resources/config/http_listener.xml

This file was deleted.

26 changes: 26 additions & 0 deletions src/Resources/config/monolog.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

declare(strict_types=1);

/*
* This file is part of Tiime New Relic bundle.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

use Monolog\Handler\NewRelicHandler;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;

return static function (ContainerConfigurator $container): void {
$services = $container->services()
->defaults()
->autowire()
->autoconfigure()
->private()
;

$services->load('Tiime\\NewRelicBundle\\Logging\\', '../../Logging/*');

$services->set('tiime.new_relic.monolog_handler', NewRelicHandler::class);
};
14 changes: 0 additions & 14 deletions src/Resources/config/monolog.xml

This file was deleted.

38 changes: 38 additions & 0 deletions src/Resources/config/services.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php

declare(strict_types=1);

/*
* This file is part of Tiime New Relic bundle.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;

use function Symfony\Component\DependencyInjection\Loader\Configurator\service;

use Tiime\NewRelicBundle\NewRelic\AdaptiveInteractor;
use Tiime\NewRelicBundle\NewRelic\BlackholeInteractor;
use Tiime\NewRelicBundle\NewRelic\NewRelicInteractor;

return static function (ContainerConfigurator $container): void {
$services = $container->services()
->defaults()
->autowire()
->autoconfigure()
->private()
;

$services->load('Tiime\\NewRelicBundle\\Command\\', '../../Command/*');
$services->load('Tiime\\NewRelicBundle\\NewRelic\\', '../../NewRelic/*');
$services->load('Tiime\\NewRelicBundle\\TransactionNamingStrategy\\', '../../TransactionNamingStrategy/*');

$services->set(AdaptiveInteractor::class)
->args([
service(NewRelicInteractor::class),
service(BlackholeInteractor::class),
])
;
};
18 changes: 0 additions & 18 deletions src/Resources/config/services.xml

This file was deleted.

23 changes: 23 additions & 0 deletions src/Resources/config/twig.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

declare(strict_types=1);

/*
* This file is part of Tiime New Relic bundle.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;

return static function (ContainerConfigurator $container): void {
$services = $container->services()
->defaults()
->autowire()
->autoconfigure()
->private()
;

$services->load('Tiime\\NewRelicBundle\\Twig\\', '../../Twig/*');
};
12 changes: 0 additions & 12 deletions src/Resources/config/twig.xml

This file was deleted.

Loading