diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 08d40b99..5963cae2 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -15,9 +15,9 @@ jobs:
strategy:
fail-fast: true
matrix:
- php: [ 8.1, 8.2, 8.3, 8.4 ]
+ php: [ 8.1, 8.2, 8.3, 8.4, 8.5 ]
deps: [ highest ]
- symfony: [ 6.4.*, 7.2.*, 7.3.* ]
+ symfony: [ 6.4.*, 7.2.*, 7.3.*, 8.0.* ]
include:
- php: 8.1
deps: lowest
@@ -27,11 +27,33 @@ jobs:
symfony: 7.2.*
- php: 8.1
symfony: 7.3.*
+ - php: 8.1
+ symfony: 8.0.*
+ - php: 8.2
+ symfony: 8.0.*
+ - php: 8.3
+ symfony: 8.0.*
+ # PHP 8.5: laminas-diagnostics 1.28+ conflicts with symfony/process < 7.4 (Symfony 6.4)
+ - php: 8.5
+ symfony: 6.4.*
steps:
- name: Checkout code
uses: actions/checkout@v4
+ - name: Validate composer.json constraints (CI requirement)
+ run: |
+ RAW=$(cat composer.json | tr -d '\n')
+ if echo "$RAW" | grep -qE 'laminas-diagnostics[^"]*"\^1\.28"'; then
+ echo "::error::composer.json must use laminas/laminas-diagnostics ^1.27 (not ^1.28) for PHP 8.1 and Symfony 6.4 compatibility."
+ exit 1
+ fi
+ if echo "$RAW" | grep -q '"require-dev"[^}]*"enlightn/security-checker"'; then
+ echo "::error::enlightn/security-checker must be in suggest only, not in require-dev. Remove it from require-dev."
+ exit 1
+ fi
+ echo "composer.json constraints OK"
+
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
@@ -39,16 +61,37 @@ jobs:
coverage: none
tools: flex
+ - name: Remove matthiasnoback for Symfony 8 (dev dep not compatible yet)
+ if: matrix.symfony == '8.0.*'
+ run: |
+ php -r "
+ \$j = json_decode(file_get_contents('composer.json'), true);
+ unset(\$j['require-dev']['matthiasnoback/symfony-dependency-injection-test']);
+ file_put_contents('composer.json', json_encode(\$j, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
+ "
+
- name: Install dependencies
+ if: matrix.symfony != '8.0.*'
uses: ramsey/composer-install@v2
with:
- dependency-versions: ${{ inputs.deps }}
+ dependency-versions: ${{ matrix.deps }}
composer-options: --prefer-dist
env:
SYMFONY_REQUIRE: ${{ matrix.symfony }}
+ - name: Install dependencies (Symfony 8)
+ if: matrix.symfony == '8.0.*'
+ run: composer update --prefer-dist
+ env:
+ SYMFONY_REQUIRE: ${{ matrix.symfony }}
+
- name: Run tests
- run: vendor/bin/phpunit -v
+ run: |
+ if [ "${{ matrix.symfony }}" = "8.0.*" ]; then
+ vendor/bin/phpunit -c phpunit-symfony8.xml.dist -v
+ else
+ vendor/bin/phpunit -v
+ fi
code-coverage:
name: Code Coverage
diff --git a/DependencyInjection/Compiler/MailerCompilerPass.php b/DependencyInjection/Compiler/MailerCompilerPass.php
index 0630cf4a..9f2b3a02 100644
--- a/DependencyInjection/Compiler/MailerCompilerPass.php
+++ b/DependencyInjection/Compiler/MailerCompilerPass.php
@@ -29,7 +29,7 @@ public function process(ContainerBuilder $container): void
throw new \InvalidArgumentException('To enable mail reporting you have to install "symfony/mailer".');
}
- $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../../Resources/config'));
- $loader->load('symfony_mailer.xml');
+ $loader = new Loader\PhpFileLoader($container, new FileLocator(__DIR__.'/../../Resources/config'));
+ $loader->load('symfony_mailer.php');
}
}
diff --git a/DependencyInjection/DoctrineMigrations/DoctrineMigrationsLoader.php b/DependencyInjection/DoctrineMigrations/DoctrineMigrationsLoader.php
index 0028eafc..588b6799 100644
--- a/DependencyInjection/DoctrineMigrations/DoctrineMigrationsLoader.php
+++ b/DependencyInjection/DoctrineMigrations/DoctrineMigrationsLoader.php
@@ -30,7 +30,7 @@ public function __construct()
public function process(ContainerBuilder $container): void
{
- if (!($this->loader instanceof CompilerPassInterface)) {
+ if (!$this->loader instanceof CompilerPassInterface) {
return;
}
diff --git a/DependencyInjection/LiipMonitorExtension.php b/DependencyInjection/LiipMonitorExtension.php
index 192eff31..57656b7b 100644
--- a/DependencyInjection/LiipMonitorExtension.php
+++ b/DependencyInjection/LiipMonitorExtension.php
@@ -32,10 +32,11 @@ public function __construct()
*/
public function load(array $configs, ContainerBuilder $container): void
{
- $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
- $loader->load('runner.xml');
- $loader->load('helper.xml');
- $loader->load('commands.xml');
+ $locator = new FileLocator(__DIR__.'/../Resources/config');
+ $loader = new Loader\PhpFileLoader($container, $locator);
+ $loader->load('runner.php');
+ $loader->load('helper.php');
+ $loader->load('commands.php');
$configuration = $this->getConfiguration($configs, $container);
$config = $this->processConfiguration($configuration, $configs);
@@ -47,7 +48,7 @@ public function load(array $configs, ContainerBuilder $container): void
if ($config['enable_controller']) {
$container->setParameter(sprintf('%s.view_template', $this->getAlias()), $config['view_template']);
$container->setParameter(sprintf('%s.failure_status_code', $this->getAlias()), $config['failure_status_code']);
- $loader->load('controller.xml');
+ $loader->load('controller.php');
}
$this->configureMailer($container, $config);
@@ -74,7 +75,7 @@ public function load(array $configs, ContainerBuilder $container): void
$this->setParameters($container, $check, $group, $values);
if (!in_array($check, $checksLoaded)) {
- $loader->load('checks/'.$check.'.xml');
+ $loader->load('checks/'.$check.'.php');
$checksLoaded[] = $check;
}
}
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 00000000..64caf944
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,16 @@
+FROM php:8.3-cli
+
+RUN apt-get update && apt-get install -y \
+ git \
+ unzip \
+ libzip-dev \
+ && docker-php-ext-install zip \
+ && apt-get clean \
+ && rm -rf /var/lib/apt/lists/*
+
+COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
+
+# Allow git operations when /app is mounted from host (different ownership)
+RUN git config --global --add safe.directory /app
+
+WORKDIR /app
diff --git a/Helper/ArrayReporter.php b/Helper/ArrayReporter.php
index a5f92edf..ef2205c2 100644
--- a/Helper/ArrayReporter.php
+++ b/Helper/ArrayReporter.php
@@ -75,7 +75,6 @@ public function onAfterRun(CheckInterface $check, ResultInterface $result, $chec
*/
public function onStart(\ArrayObject $checks, $runnerConfig)
{
- return;
}
/**
@@ -91,7 +90,6 @@ public function onBeforeRun(CheckInterface $check, $checkAlias = null)
*/
public function onStop(ResultsCollection $results)
{
- return;
}
/**
@@ -99,6 +97,5 @@ public function onStop(ResultsCollection $results)
*/
public function onFinish(ResultsCollection $results)
{
- return;
}
}
diff --git a/Helper/ConsoleReporter.php b/Helper/ConsoleReporter.php
index 7c9a6579..158b10b8 100644
--- a/Helper/ConsoleReporter.php
+++ b/Helper/ConsoleReporter.php
@@ -71,7 +71,6 @@ public function onAfterRun(CheckInterface $check, ResultInterface $result, $chec
*/
public function onStart(\ArrayObject $checks, $runnerConfig)
{
- return;
}
/**
@@ -79,7 +78,6 @@ public function onStart(\ArrayObject $checks, $runnerConfig)
*/
public function onBeforeRun(CheckInterface $check, $checkAlias = null)
{
- return;
}
/**
@@ -87,7 +85,6 @@ public function onBeforeRun(CheckInterface $check, $checkAlias = null)
*/
public function onStop(ResultsCollection $results)
{
- return;
}
/**
@@ -95,6 +92,5 @@ public function onStop(ResultsCollection $results)
*/
public function onFinish(ResultsCollection $results)
{
- return;
}
}
diff --git a/Helper/RawConsoleReporter.php b/Helper/RawConsoleReporter.php
index 181f35ee..141e096d 100644
--- a/Helper/RawConsoleReporter.php
+++ b/Helper/RawConsoleReporter.php
@@ -72,7 +72,6 @@ protected function getNagiosPerformanceData(): string
*/
public function onStart(\ArrayObject $checks, $runnerConfig)
{
- return;
}
/**
@@ -80,7 +79,6 @@ public function onStart(\ArrayObject $checks, $runnerConfig)
*/
public function onBeforeRun(CheckInterface $check, $checkAlias = null)
{
- return;
}
/**
@@ -88,7 +86,6 @@ public function onBeforeRun(CheckInterface $check, $checkAlias = null)
*/
public function onStop(ResultsCollection $results)
{
- return;
}
/**
@@ -96,6 +93,5 @@ public function onStop(ResultsCollection $results)
*/
public function onFinish(ResultsCollection $results)
{
- return;
}
}
diff --git a/README.md b/README.md
index 465d663e..f287c370 100644
--- a/README.md
+++ b/README.md
@@ -59,7 +59,7 @@ If you want to enable the REST API provided by the bundle then add the following
```yml
_monitor:
- resource: "@LiipMonitorBundle/Resources/config/routing.xml"
+ resource: "@LiipMonitorBundle/Resources/config/routing.yaml"
prefix: /monitor/health
```
@@ -488,7 +488,7 @@ liip_monitor:
## REST API DOCS ##
For documentation on the REST API see: [http://myproject.org/monitor/health/](http://myproject.org/monitor/health/).
-Don't forget to add the bundle routes in your `routing.xml` file.
+Don't forget to add the bundle routes in your `routing.yaml` file.
## Nagios integration ##
diff --git a/Resources/config/checks/apc_fragmentation.php b/Resources/config/checks/apc_fragmentation.php
new file mode 100644
index 00000000..c21433cc
--- /dev/null
+++ b/Resources/config/checks/apc_fragmentation.php
@@ -0,0 +1,14 @@
+services()
+ ->set('liip_monitor.check.apc_fragmentation', \Laminas\Diagnostics\Check\ApcFragmentation::class)
+ ->args([
+ '%%liip_monitor.check.apc_fragmentation.warning%%',
+ '%%liip_monitor.check.apc_fragmentation.critical%%',
+ ])
+ ->tag('liip_monitor.check', ['alias' => 'apc_fragmentation'])
+ ->public();
+};
diff --git a/Resources/config/checks/apc_fragmentation.xml b/Resources/config/checks/apc_fragmentation.xml
deleted file mode 100644
index db4b60de..00000000
--- a/Resources/config/checks/apc_fragmentation.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
- %%liip_monitor.check.apc_fragmentation.warning%%
- %%liip_monitor.check.apc_fragmentation.critical%%
-
-
-
-
diff --git a/Resources/config/checks/apc_memory.php b/Resources/config/checks/apc_memory.php
new file mode 100644
index 00000000..d69cf9be
--- /dev/null
+++ b/Resources/config/checks/apc_memory.php
@@ -0,0 +1,14 @@
+services()
+ ->set('liip_monitor.check.apc_memory', \Laminas\Diagnostics\Check\ApcMemory::class)
+ ->args([
+ '%%liip_monitor.check.apc_memory.warning%%',
+ '%%liip_monitor.check.apc_memory.critical%%',
+ ])
+ ->tag('liip_monitor.check', ['alias' => 'apc_memory'])
+ ->public();
+};
diff --git a/Resources/config/checks/apc_memory.xml b/Resources/config/checks/apc_memory.xml
deleted file mode 100644
index fe9bed56..00000000
--- a/Resources/config/checks/apc_memory.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
- %%liip_monitor.check.apc_memory.warning%%
- %%liip_monitor.check.apc_memory.critical%%
-
-
-
-
diff --git a/Resources/config/checks/class_exists.php b/Resources/config/checks/class_exists.php
new file mode 100644
index 00000000..0d699c53
--- /dev/null
+++ b/Resources/config/checks/class_exists.php
@@ -0,0 +1,11 @@
+services()
+ ->set('liip_monitor.check.class_exists', \Laminas\Diagnostics\Check\ClassExists::class)
+ ->args(['%%liip_monitor.check.class_exists%%'])
+ ->tag('liip_monitor.check', ['alias' => 'class_exists'])
+ ->public();
+};
diff --git a/Resources/config/checks/class_exists.xml b/Resources/config/checks/class_exists.xml
deleted file mode 100644
index c476ff49..00000000
--- a/Resources/config/checks/class_exists.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
- %%liip_monitor.check.class_exists%%
-
-
-
-
diff --git a/Resources/config/checks/cpu_performance.php b/Resources/config/checks/cpu_performance.php
new file mode 100644
index 00000000..d503da8c
--- /dev/null
+++ b/Resources/config/checks/cpu_performance.php
@@ -0,0 +1,11 @@
+services()
+ ->set('liip_monitor.check.cpu_performance', \Laminas\Diagnostics\Check\CpuPerformance::class)
+ ->args(['%%liip_monitor.check.cpu_performance%%'])
+ ->tag('liip_monitor.check', ['alias' => 'cpu_performance'])
+ ->public();
+};
diff --git a/Resources/config/checks/cpu_performance.xml b/Resources/config/checks/cpu_performance.xml
deleted file mode 100644
index 454c99d3..00000000
--- a/Resources/config/checks/cpu_performance.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
- %%liip_monitor.check.cpu_performance%%
-
-
-
-
diff --git a/Resources/config/checks/custom_error_pages.php b/Resources/config/checks/custom_error_pages.php
new file mode 100644
index 00000000..d39e2c08
--- /dev/null
+++ b/Resources/config/checks/custom_error_pages.php
@@ -0,0 +1,15 @@
+services()
+ ->set('liip_monitor.check.custom_error_pages', \Liip\MonitorBundle\Check\CustomErrorPages::class)
+ ->args([
+ '%%liip_monitor.check.custom_error_pages.error_codes%%',
+ '%%liip_monitor.check.custom_error_pages.path%%',
+ param('kernel.project_dir'),
+ ])
+ ->tag('liip_monitor.check', ['alias' => 'custom_error_pages'])
+ ->public();
+};
diff --git a/Resources/config/checks/custom_error_pages.xml b/Resources/config/checks/custom_error_pages.xml
deleted file mode 100644
index 092430b8..00000000
--- a/Resources/config/checks/custom_error_pages.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
- %%liip_monitor.check.custom_error_pages.error_codes%%
- %%liip_monitor.check.custom_error_pages.path%%
- %kernel.project_dir%
-
-
-
-
diff --git a/Resources/config/checks/disk_usage.php b/Resources/config/checks/disk_usage.php
new file mode 100644
index 00000000..5d90e486
--- /dev/null
+++ b/Resources/config/checks/disk_usage.php
@@ -0,0 +1,15 @@
+services()
+ ->set('liip_monitor.check.disk_usage', \Laminas\Diagnostics\Check\DiskUsage::class)
+ ->args([
+ '%%liip_monitor.check.disk_usage.warning%%',
+ '%%liip_monitor.check.disk_usage.critical%%',
+ '%%liip_monitor.check.disk_usage.path%%',
+ ])
+ ->tag('liip_monitor.check', ['alias' => 'disk_usage'])
+ ->public();
+};
diff --git a/Resources/config/checks/disk_usage.xml b/Resources/config/checks/disk_usage.xml
deleted file mode 100644
index 465dc196..00000000
--- a/Resources/config/checks/disk_usage.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
- %%liip_monitor.check.disk_usage.warning%%
- %%liip_monitor.check.disk_usage.critical%%
- %%liip_monitor.check.disk_usage.path%%
-
-
-
-
diff --git a/Resources/config/checks/doctrine_dbal.php b/Resources/config/checks/doctrine_dbal.php
new file mode 100644
index 00000000..f3f4cbff
--- /dev/null
+++ b/Resources/config/checks/doctrine_dbal.php
@@ -0,0 +1,14 @@
+services()
+ ->set('liip_monitor.check.doctrine_dbal', \Liip\MonitorBundle\Check\DoctrineDbalCollection::class)
+ ->args([
+ service('doctrine'),
+ '%%liip_monitor.check.doctrine_dbal%%',
+ ])
+ ->tag('liip_monitor.check_collection')
+ ->public();
+};
diff --git a/Resources/config/checks/doctrine_dbal.xml b/Resources/config/checks/doctrine_dbal.xml
deleted file mode 100644
index 51dd9eda..00000000
--- a/Resources/config/checks/doctrine_dbal.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
- %%liip_monitor.check.doctrine_dbal%%
-
-
-
-
diff --git a/Resources/config/checks/doctrine_migrations.php b/Resources/config/checks/doctrine_migrations.php
new file mode 100644
index 00000000..f086cc1c
--- /dev/null
+++ b/Resources/config/checks/doctrine_migrations.php
@@ -0,0 +1,14 @@
+services()
+ ->set('liip_monitor.check.doctrine_migrations', \Liip\MonitorBundle\Check\DoctrineMigrationsCollection::class)
+ ->args([
+ service('service_container'),
+ '%%liip_monitor.check.doctrine_migrations%%',
+ ])
+ ->tag('liip_monitor.check_collection')
+ ->public();
+};
diff --git a/Resources/config/checks/doctrine_migrations.xml b/Resources/config/checks/doctrine_migrations.xml
deleted file mode 100644
index 7b6ea15f..00000000
--- a/Resources/config/checks/doctrine_migrations.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
- %%liip_monitor.check.doctrine_migrations%%
-
-
-
-
-
diff --git a/Resources/config/checks/doctrine_mongodb.php b/Resources/config/checks/doctrine_mongodb.php
new file mode 100644
index 00000000..42745ab7
--- /dev/null
+++ b/Resources/config/checks/doctrine_mongodb.php
@@ -0,0 +1,14 @@
+services()
+ ->set('liip_monitor.check.doctrine_mongodb', \Liip\MonitorBundle\Check\DoctrineMongoDbCollection::class)
+ ->args([
+ service('doctrine_mongodb'),
+ '%%liip_monitor.check.doctrine_mongodb%%',
+ ])
+ ->tag('liip_monitor.check_collection')
+ ->public();
+};
diff --git a/Resources/config/checks/doctrine_mongodb.xml b/Resources/config/checks/doctrine_mongodb.xml
deleted file mode 100644
index e23953ad..00000000
--- a/Resources/config/checks/doctrine_mongodb.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
- %%liip_monitor.check.doctrine_mongodb%%
-
-
-
-
diff --git a/Resources/config/checks/expressions.php b/Resources/config/checks/expressions.php
new file mode 100644
index 00000000..db0809bd
--- /dev/null
+++ b/Resources/config/checks/expressions.php
@@ -0,0 +1,11 @@
+services()
+ ->set('liip_monitor.check.expressions', \Liip\MonitorBundle\Check\ExpressionCollection::class)
+ ->args(['%%liip_monitor.check.expressions%%'])
+ ->tag('liip_monitor.check_collection')
+ ->public();
+};
diff --git a/Resources/config/checks/expressions.xml b/Resources/config/checks/expressions.xml
deleted file mode 100644
index 1c27b351..00000000
--- a/Resources/config/checks/expressions.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
- %%liip_monitor.check.expressions%%
-
-
-
-
diff --git a/Resources/config/checks/file_ini.php b/Resources/config/checks/file_ini.php
new file mode 100644
index 00000000..8c34710e
--- /dev/null
+++ b/Resources/config/checks/file_ini.php
@@ -0,0 +1,15 @@
+parameters()
+ ->set('liip_monitor.check.file_ini.label', 'File (INI)');
+
+ $container->services()
+ ->set('liip_monitor.check.file_ini', \Laminas\Diagnostics\Check\IniFile::class)
+ ->args(['%%liip_monitor.check.file_ini%%'])
+ ->call('setLabel', [param('liip_monitor.check.file_ini.label')])
+ ->tag('liip_monitor.check', ['alias' => 'file_ini'])
+ ->public();
+};
diff --git a/Resources/config/checks/file_ini.xml b/Resources/config/checks/file_ini.xml
deleted file mode 100644
index 0c3621bd..00000000
--- a/Resources/config/checks/file_ini.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
- File (INI)
-
-
-
-
- %%liip_monitor.check.file_ini%%
-
- %liip_monitor.check.file_ini.label%
-
-
-
-
-
diff --git a/Resources/config/checks/file_json.php b/Resources/config/checks/file_json.php
new file mode 100644
index 00000000..97faa489
--- /dev/null
+++ b/Resources/config/checks/file_json.php
@@ -0,0 +1,15 @@
+parameters()
+ ->set('liip_monitor.check.file_json.label', 'File (JSON)');
+
+ $container->services()
+ ->set('liip_monitor.check.file_json', \Laminas\Diagnostics\Check\JsonFile::class)
+ ->args(['%%liip_monitor.check.file_json%%'])
+ ->call('setLabel', [param('liip_monitor.check.file_json.label')])
+ ->tag('liip_monitor.check', ['alias' => 'file_json'])
+ ->public();
+};
diff --git a/Resources/config/checks/file_json.xml b/Resources/config/checks/file_json.xml
deleted file mode 100644
index b8e92435..00000000
--- a/Resources/config/checks/file_json.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
- File (JSON)
-
-
-
-
- %%liip_monitor.check.file_json%%
-
- %liip_monitor.check.file_json.label%
-
-
-
-
-
diff --git a/Resources/config/checks/file_xml.php b/Resources/config/checks/file_xml.php
new file mode 100644
index 00000000..3545a378
--- /dev/null
+++ b/Resources/config/checks/file_xml.php
@@ -0,0 +1,15 @@
+parameters()
+ ->set('liip_monitor.check.file_xml.label', 'File (XML)');
+
+ $container->services()
+ ->set('liip_monitor.check.file_xml', \Laminas\Diagnostics\Check\XmlFile::class)
+ ->args(['%%liip_monitor.check.file_xml%%'])
+ ->call('setLabel', [param('liip_monitor.check.file_xml.label')])
+ ->tag('liip_monitor.check', ['alias' => 'file_xml'])
+ ->public();
+};
diff --git a/Resources/config/checks/file_xml.xml b/Resources/config/checks/file_xml.xml
deleted file mode 100644
index 87fb3509..00000000
--- a/Resources/config/checks/file_xml.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
- File (XML)
-
-
-
-
- %%liip_monitor.check.file_xml%%
-
- %liip_monitor.check.file_xml.label%
-
-
-
-
-
diff --git a/Resources/config/checks/file_yaml.php b/Resources/config/checks/file_yaml.php
new file mode 100644
index 00000000..7181154b
--- /dev/null
+++ b/Resources/config/checks/file_yaml.php
@@ -0,0 +1,15 @@
+parameters()
+ ->set('liip_monitor.check.file_yaml.label', 'File (YAML)');
+
+ $container->services()
+ ->set('liip_monitor.check.file_yaml', \Laminas\Diagnostics\Check\YamlFile::class)
+ ->args(['%%liip_monitor.check.file_yaml%%'])
+ ->call('setLabel', [param('liip_monitor.check.file_yaml.label')])
+ ->tag('liip_monitor.check', ['alias' => 'file_yaml'])
+ ->public();
+};
diff --git a/Resources/config/checks/file_yaml.xml b/Resources/config/checks/file_yaml.xml
deleted file mode 100644
index 76b93a12..00000000
--- a/Resources/config/checks/file_yaml.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
- File (YAML)
-
-
-
-
- %%liip_monitor.check.file_yaml%%
-
- %liip_monitor.check.file_yaml.label%
-
-
-
-
-
diff --git a/Resources/config/checks/guzzle_http_service.php b/Resources/config/checks/guzzle_http_service.php
new file mode 100644
index 00000000..6fdd7291
--- /dev/null
+++ b/Resources/config/checks/guzzle_http_service.php
@@ -0,0 +1,11 @@
+services()
+ ->set('liip_monitor.check.guzzle_http_service', \Liip\MonitorBundle\Check\GuzzleHttpServiceCollection::class)
+ ->args(['%%liip_monitor.check.guzzle_http_service%%'])
+ ->tag('liip_monitor.check_collection')
+ ->public();
+};
diff --git a/Resources/config/checks/guzzle_http_service.xml b/Resources/config/checks/guzzle_http_service.xml
deleted file mode 100644
index f8dbe5ee..00000000
--- a/Resources/config/checks/guzzle_http_service.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
- %%liip_monitor.check.guzzle_http_service%%
-
-
-
-
diff --git a/Resources/config/checks/http_service.php b/Resources/config/checks/http_service.php
new file mode 100644
index 00000000..e52c5ff2
--- /dev/null
+++ b/Resources/config/checks/http_service.php
@@ -0,0 +1,11 @@
+services()
+ ->set('liip_monitor.check.http_service', \Liip\MonitorBundle\Check\HttpServiceCollection::class)
+ ->args(['%%liip_monitor.check.http_service%%'])
+ ->tag('liip_monitor.check_collection')
+ ->public();
+};
diff --git a/Resources/config/checks/http_service.xml b/Resources/config/checks/http_service.xml
deleted file mode 100644
index 7fe6d728..00000000
--- a/Resources/config/checks/http_service.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
- %%liip_monitor.check.http_service%%
-
-
-
-
diff --git a/Resources/config/checks/memcache.php b/Resources/config/checks/memcache.php
new file mode 100644
index 00000000..782af0c0
--- /dev/null
+++ b/Resources/config/checks/memcache.php
@@ -0,0 +1,11 @@
+services()
+ ->set('liip_monitor.check.memcache', \Liip\MonitorBundle\Check\MemcacheCollection::class)
+ ->args(['%%liip_monitor.check.memcache%%'])
+ ->tag('liip_monitor.check_collection')
+ ->public();
+};
diff --git a/Resources/config/checks/memcache.xml b/Resources/config/checks/memcache.xml
deleted file mode 100644
index 0a25a67e..00000000
--- a/Resources/config/checks/memcache.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
- %%liip_monitor.check.memcache%%
-
-
-
-
diff --git a/Resources/config/checks/memcached.php b/Resources/config/checks/memcached.php
new file mode 100644
index 00000000..5b123bc0
--- /dev/null
+++ b/Resources/config/checks/memcached.php
@@ -0,0 +1,11 @@
+services()
+ ->set('liip_monitor.check.memcached', \Liip\MonitorBundle\Check\MemcachedCollection::class)
+ ->args(['%%liip_monitor.check.memcached%%'])
+ ->tag('liip_monitor.check_collection')
+ ->public();
+};
diff --git a/Resources/config/checks/memcached.xml b/Resources/config/checks/memcached.xml
deleted file mode 100644
index 7d2b1131..00000000
--- a/Resources/config/checks/memcached.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
- %%liip_monitor.check.memcached%%
-
-
-
-
diff --git a/Resources/config/checks/messenger_transports.php b/Resources/config/checks/messenger_transports.php
new file mode 100644
index 00000000..b888a654
--- /dev/null
+++ b/Resources/config/checks/messenger_transports.php
@@ -0,0 +1,14 @@
+services()
+ ->set('liip_monitor.check.messenger_transports', \Liip\MonitorBundle\Check\SymfonyMessengerTransportCountCollection::class)
+ ->args([
+ service('messenger.receiver_locator'),
+ '%%liip_monitor.check.messenger_transports%%',
+ ])
+ ->tag('liip_monitor.check_collection')
+ ->public();
+};
diff --git a/Resources/config/checks/messenger_transports.xml b/Resources/config/checks/messenger_transports.xml
deleted file mode 100644
index a339344b..00000000
--- a/Resources/config/checks/messenger_transports.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
- %%liip_monitor.check.messenger_transports%%
-
-
-
-
diff --git a/Resources/config/checks/opcache_memory.php b/Resources/config/checks/opcache_memory.php
new file mode 100644
index 00000000..744ea5a0
--- /dev/null
+++ b/Resources/config/checks/opcache_memory.php
@@ -0,0 +1,14 @@
+services()
+ ->set('liip_monitor.check.opcache_memory', \Laminas\Diagnostics\Check\OpCacheMemory::class)
+ ->args([
+ '%%liip_monitor.check.opcache_memory.warning%%',
+ '%%liip_monitor.check.opcache_memory.critical%%',
+ ])
+ ->tag('liip_monitor.check', ['alias' => 'opcache_memory'])
+ ->public();
+};
diff --git a/Resources/config/checks/opcache_memory.xml b/Resources/config/checks/opcache_memory.xml
deleted file mode 100644
index b6cc9157..00000000
--- a/Resources/config/checks/opcache_memory.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
- %%liip_monitor.check.opcache_memory.warning%%
- %%liip_monitor.check.opcache_memory.critical%%
-
-
-
-
diff --git a/Resources/config/checks/pdo_connections.php b/Resources/config/checks/pdo_connections.php
new file mode 100644
index 00000000..7491540b
--- /dev/null
+++ b/Resources/config/checks/pdo_connections.php
@@ -0,0 +1,11 @@
+services()
+ ->set('liip_monitor.check.pdo_connections', \Liip\MonitorBundle\Check\PdoConnectionCollection::class)
+ ->args(['%%liip_monitor.check.pdo_connections%%'])
+ ->tag('liip_monitor.check_collection')
+ ->public();
+};
diff --git a/Resources/config/checks/pdo_connections.xml b/Resources/config/checks/pdo_connections.xml
deleted file mode 100644
index 03aae07c..00000000
--- a/Resources/config/checks/pdo_connections.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
- %%liip_monitor.check.pdo_connections%%
-
-
-
-
diff --git a/Resources/config/checks/php_extensions.php b/Resources/config/checks/php_extensions.php
new file mode 100644
index 00000000..41db2b43
--- /dev/null
+++ b/Resources/config/checks/php_extensions.php
@@ -0,0 +1,11 @@
+services()
+ ->set('liip_monitor.check.php_extensions', \Laminas\Diagnostics\Check\ExtensionLoaded::class)
+ ->args(['%%liip_monitor.check.php_extensions%%'])
+ ->tag('liip_monitor.check', ['alias' => 'php_extensions'])
+ ->public();
+};
diff --git a/Resources/config/checks/php_extensions.xml b/Resources/config/checks/php_extensions.xml
deleted file mode 100644
index b99192a1..00000000
--- a/Resources/config/checks/php_extensions.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
- %%liip_monitor.check.php_extensions%%
-
-
-
-
diff --git a/Resources/config/checks/php_flags.php b/Resources/config/checks/php_flags.php
new file mode 100644
index 00000000..8664488f
--- /dev/null
+++ b/Resources/config/checks/php_flags.php
@@ -0,0 +1,11 @@
+services()
+ ->set('liip_monitor.check.php_flags', \Liip\MonitorBundle\Check\PhpFlagsCollection::class)
+ ->args(['%%liip_monitor.check.php_flags%%'])
+ ->tag('liip_monitor.check_collection')
+ ->public();
+};
diff --git a/Resources/config/checks/php_flags.xml b/Resources/config/checks/php_flags.xml
deleted file mode 100644
index 73dc239d..00000000
--- a/Resources/config/checks/php_flags.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
- %%liip_monitor.check.php_flags%%
-
-
-
-
diff --git a/Resources/config/checks/php_version.php b/Resources/config/checks/php_version.php
new file mode 100644
index 00000000..18c13863
--- /dev/null
+++ b/Resources/config/checks/php_version.php
@@ -0,0 +1,11 @@
+services()
+ ->set('liip_monitor.check.php_version', \Liip\MonitorBundle\Check\PhpVersionCollection::class)
+ ->args(['%%liip_monitor.check.php_version%%'])
+ ->tag('liip_monitor.check_collection')
+ ->public();
+};
diff --git a/Resources/config/checks/php_version.xml b/Resources/config/checks/php_version.xml
deleted file mode 100644
index 782022d8..00000000
--- a/Resources/config/checks/php_version.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
- %%liip_monitor.check.php_version%%
-
-
-
-
diff --git a/Resources/config/checks/process_running.php b/Resources/config/checks/process_running.php
new file mode 100644
index 00000000..d21dfea2
--- /dev/null
+++ b/Resources/config/checks/process_running.php
@@ -0,0 +1,11 @@
+services()
+ ->set('liip_monitor.check.process_running', \Liip\MonitorBundle\Check\ProcessRunningCollection::class)
+ ->args(['%%liip_monitor.check.process_running%%'])
+ ->tag('liip_monitor.check_collection')
+ ->public();
+};
diff --git a/Resources/config/checks/process_running.xml b/Resources/config/checks/process_running.xml
deleted file mode 100644
index b732e4a2..00000000
--- a/Resources/config/checks/process_running.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
- %%liip_monitor.check.process_running%%
-
-
-
-
diff --git a/Resources/config/checks/rabbit_mq.php b/Resources/config/checks/rabbit_mq.php
new file mode 100644
index 00000000..dd9d661e
--- /dev/null
+++ b/Resources/config/checks/rabbit_mq.php
@@ -0,0 +1,11 @@
+services()
+ ->set('liip_monitor.check.rabbit_mq', \Liip\MonitorBundle\Check\RabbitMQCollection::class)
+ ->args(['%%liip_monitor.check.rabbit_mq%%'])
+ ->tag('liip_monitor.check_collection')
+ ->public();
+};
diff --git a/Resources/config/checks/rabbit_mq.xml b/Resources/config/checks/rabbit_mq.xml
deleted file mode 100644
index 24ee28f6..00000000
--- a/Resources/config/checks/rabbit_mq.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
- %%liip_monitor.check.rabbit_mq%%
-
-
-
-
diff --git a/Resources/config/checks/readable_directory.php b/Resources/config/checks/readable_directory.php
new file mode 100644
index 00000000..c97ed7a7
--- /dev/null
+++ b/Resources/config/checks/readable_directory.php
@@ -0,0 +1,11 @@
+services()
+ ->set('liip_monitor.check.readable_directory', \Laminas\Diagnostics\Check\DirReadable::class)
+ ->args(['%%liip_monitor.check.readable_directory%%'])
+ ->tag('liip_monitor.check', ['alias' => 'readable_directory'])
+ ->public();
+};
diff --git a/Resources/config/checks/readable_directory.xml b/Resources/config/checks/readable_directory.xml
deleted file mode 100644
index 42eae022..00000000
--- a/Resources/config/checks/readable_directory.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
- %%liip_monitor.check.readable_directory%%
-
-
-
-
diff --git a/Resources/config/checks/redis.php b/Resources/config/checks/redis.php
new file mode 100644
index 00000000..1aee1791
--- /dev/null
+++ b/Resources/config/checks/redis.php
@@ -0,0 +1,11 @@
+services()
+ ->set('liip_monitor.check.redis', \Liip\MonitorBundle\Check\RedisCollection::class)
+ ->args(['%%liip_monitor.check.redis%%'])
+ ->tag('liip_monitor.check_collection')
+ ->public();
+};
diff --git a/Resources/config/checks/redis.xml b/Resources/config/checks/redis.xml
deleted file mode 100644
index 3a00676b..00000000
--- a/Resources/config/checks/redis.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
- %%liip_monitor.check.redis%%
-
-
-
-
diff --git a/Resources/config/checks/security_advisory.php b/Resources/config/checks/security_advisory.php
new file mode 100644
index 00000000..210c1489
--- /dev/null
+++ b/Resources/config/checks/security_advisory.php
@@ -0,0 +1,15 @@
+services()
+ ->set('liip_monitor.check.security_advisory', \Laminas\Diagnostics\Check\SecurityAdvisory::class)
+ ->args(['%%liip_monitor.check.security_advisory.lock_file%%'])
+ ->tag('liip_monitor.check', ['alias' => 'security_advisory'])
+ ->public();
+};
diff --git a/Resources/config/checks/security_advisory.xml b/Resources/config/checks/security_advisory.xml
deleted file mode 100644
index 4660dd43..00000000
--- a/Resources/config/checks/security_advisory.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
- %%liip_monitor.check.security_advisory.lock_file%%
-
-
-
-
diff --git a/Resources/config/checks/stream_wrapper_exists.php b/Resources/config/checks/stream_wrapper_exists.php
new file mode 100644
index 00000000..f4669735
--- /dev/null
+++ b/Resources/config/checks/stream_wrapper_exists.php
@@ -0,0 +1,11 @@
+services()
+ ->set('liip_monitor.check.stream_wrapper_exists', \Laminas\Diagnostics\Check\StreamWrapperExists::class)
+ ->args(['%%liip_monitor.check.stream_wrapper_exists%%'])
+ ->tag('liip_monitor.check', ['alias' => 'stream_wrapper_exists'])
+ ->public();
+};
diff --git a/Resources/config/checks/stream_wrapper_exists.xml b/Resources/config/checks/stream_wrapper_exists.xml
deleted file mode 100644
index 2ffbec9c..00000000
--- a/Resources/config/checks/stream_wrapper_exists.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
- %%liip_monitor.check.stream_wrapper_exists%%
-
-
-
-
diff --git a/Resources/config/checks/symfony_requirements.php b/Resources/config/checks/symfony_requirements.php
new file mode 100644
index 00000000..899e2364
--- /dev/null
+++ b/Resources/config/checks/symfony_requirements.php
@@ -0,0 +1,11 @@
+services()
+ ->set('liip_monitor.check.symfony_requirements', \Liip\MonitorBundle\Check\SymfonyRequirements::class)
+ ->args(['%%liip_monitor.check.symfony_requirements.file%%'])
+ ->tag('liip_monitor.check', ['alias' => 'symfony_requirements'])
+ ->public();
+};
diff --git a/Resources/config/checks/symfony_requirements.xml b/Resources/config/checks/symfony_requirements.xml
deleted file mode 100644
index e8a91091..00000000
--- a/Resources/config/checks/symfony_requirements.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
- %%liip_monitor.check.symfony_requirements.file%%
-
-
-
-
diff --git a/Resources/config/checks/symfony_version.php b/Resources/config/checks/symfony_version.php
new file mode 100644
index 00000000..32c24f67
--- /dev/null
+++ b/Resources/config/checks/symfony_version.php
@@ -0,0 +1,10 @@
+services()
+ ->set('liip_monitor.check.symfony_version', \Liip\MonitorBundle\Check\SymfonyVersion::class)
+ ->tag('liip_monitor.check', ['alias' => 'symfony_version'])
+ ->public();
+};
diff --git a/Resources/config/checks/symfony_version.xml b/Resources/config/checks/symfony_version.xml
deleted file mode 100644
index 7c7f3b43..00000000
--- a/Resources/config/checks/symfony_version.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/Resources/config/checks/writable_directory.php b/Resources/config/checks/writable_directory.php
new file mode 100644
index 00000000..dcdc9002
--- /dev/null
+++ b/Resources/config/checks/writable_directory.php
@@ -0,0 +1,11 @@
+services()
+ ->set('liip_monitor.check.writable_directory', \Laminas\Diagnostics\Check\DirWritable::class)
+ ->args(['%%liip_monitor.check.writable_directory%%'])
+ ->tag('liip_monitor.check', ['alias' => 'writable_directory'])
+ ->public();
+};
diff --git a/Resources/config/checks/writable_directory.xml b/Resources/config/checks/writable_directory.xml
deleted file mode 100644
index f99758f8..00000000
--- a/Resources/config/checks/writable_directory.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
- %%liip_monitor.check.writable_directory%%
-
-
-
-
diff --git a/Resources/config/commands.php b/Resources/config/commands.php
new file mode 100644
index 00000000..97ba1606
--- /dev/null
+++ b/Resources/config/commands.php
@@ -0,0 +1,24 @@
+services();
+
+ $services->set('liip_monitor.health_check.command', \Liip\MonitorBundle\Command\HealthCheckCommand::class)
+ ->args([
+ service('liip_monitor.helper.console_reporter'),
+ service('liip_monitor.helper.raw_console_reporter'),
+ service('liip_monitor.helper.runner_manager'),
+ ])
+ ->tag('console.command', ['command' => 'monitor:health'])
+ ->public();
+
+ $services->set('liip_monitor.list_checks.command', \Liip\MonitorBundle\Command\ListChecksCommand::class)
+ ->args([
+ service('liip_monitor.helper.runner_manager'),
+ service('liip_monitor.runner'),
+ ])
+ ->tag('console.command', ['command' => 'monitor:list'])
+ ->public();
+};
diff --git a/Resources/config/commands.xml b/Resources/config/commands.xml
deleted file mode 100644
index 871a1ea8..00000000
--- a/Resources/config/commands.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Resources/config/controller.php b/Resources/config/controller.php
new file mode 100644
index 00000000..256be175
--- /dev/null
+++ b/Resources/config/controller.php
@@ -0,0 +1,26 @@
+services();
+
+ $services->alias(\Liip\MonitorBundle\Controller\HealthCheckController::class, 'liip_monitor.health_controller')
+ ->public();
+
+ $services->set('liip_monitor.helper', \Liip\MonitorBundle\Helper\PathHelper::class)
+ ->args([
+ service('assets.packages'),
+ service('router'),
+ ])
+ ->public();
+
+ $services->set('liip_monitor.health_controller', \Liip\MonitorBundle\Controller\HealthCheckController::class)
+ ->args([
+ service('liip_monitor.helper.runner_manager'),
+ service('liip_monitor.helper'),
+ param('liip_monitor.view_template'),
+ param('liip_monitor.failure_status_code'),
+ ])
+ ->public();
+};
diff --git a/Resources/config/controller.xml b/Resources/config/controller.xml
deleted file mode 100644
index 8b46277f..00000000
--- a/Resources/config/controller.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- %liip_monitor.view_template%
- %liip_monitor.failure_status_code%
-
-
-
diff --git a/Resources/config/helper.php b/Resources/config/helper.php
new file mode 100644
index 00000000..6798b4b8
--- /dev/null
+++ b/Resources/config/helper.php
@@ -0,0 +1,17 @@
+services();
+
+ $services->set('liip_monitor.helper.raw_console_reporter', \Liip\MonitorBundle\Helper\RawConsoleReporter::class)
+ ->public();
+
+ $services->set('liip_monitor.helper.console_reporter', \Liip\MonitorBundle\Helper\ConsoleReporter::class)
+ ->public();
+
+ $services->set('liip_monitor.helper.runner_manager', \Liip\MonitorBundle\Helper\RunnerManager::class)
+ ->args([service('service_container')])
+ ->public();
+};
diff --git a/Resources/config/helper.xml b/Resources/config/helper.xml
deleted file mode 100644
index f3636662..00000000
--- a/Resources/config/helper.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Resources/config/routing.php b/Resources/config/routing.php
index 91742233..650cd30a 100644
--- a/Resources/config/routing.php
+++ b/Resources/config/routing.php
@@ -4,7 +4,7 @@
$routes = new RouteCollection();
$routes->addCollection(
- $loader->import('@LiipMonitorBundle/Resources/config/routing.xml')
+ $loader->import('@LiipMonitorBundle/Resources/config/routing.yaml')
);
return $routes;
diff --git a/Resources/config/routing.xml b/Resources/config/routing.xml
deleted file mode 100644
index a38eade0..00000000
--- a/Resources/config/routing.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-
- Liip\MonitorBundle\Controller\HealthCheckController::indexAction
-
-
- Liip\MonitorBundle\Controller\HealthCheckController::listAction
-
-
- Liip\MonitorBundle\Controller\HealthCheckController::listAllAction
-
-
- Liip\MonitorBundle\Controller\HealthCheckController::listGroupsAction
-
-
- Liip\MonitorBundle\Controller\HealthCheckController::runAllChecksHttpStatusAction
-
-
- Liip\MonitorBundle\Controller\HealthCheckController::runSingleCheckHttpStatusAction
-
-
- Liip\MonitorBundle\Controller\HealthCheckController::runAllChecksAction
-
-
- Liip\MonitorBundle\Controller\HealthCheckController::runSingleCheckAction
-
-
- Liip\MonitorBundle\Controller\HealthCheckController::listReportersAction
-
-
diff --git a/Resources/config/routing.yaml b/Resources/config/routing.yaml
new file mode 100644
index 00000000..c4cebfe1
--- /dev/null
+++ b/Resources/config/routing.yaml
@@ -0,0 +1,44 @@
+liip_monitor_health_interface:
+ path: /
+ defaults:
+ _controller: Liip\MonitorBundle\Controller\HealthCheckController::indexAction
+
+liip_monitor_list_checks:
+ path: /checks
+ defaults:
+ _controller: Liip\MonitorBundle\Controller\HealthCheckController::listAction
+
+liip_monitor_list_all_checks:
+ path: /all_checks
+ defaults:
+ _controller: Liip\MonitorBundle\Controller\HealthCheckController::listAllAction
+
+liip_monitor_list_groups:
+ path: /groups
+ defaults:
+ _controller: Liip\MonitorBundle\Controller\HealthCheckController::listGroupsAction
+
+liip_monitor_run_all_checks_http_status:
+ path: /http_status_checks
+ defaults:
+ _controller: Liip\MonitorBundle\Controller\HealthCheckController::runAllChecksHttpStatusAction
+
+liip_monitor_run_single_check_http_status:
+ path: /http_status_check/{checkId}
+ defaults:
+ _controller: Liip\MonitorBundle\Controller\HealthCheckController::runSingleCheckHttpStatusAction
+
+liip_monitor_run_all_checks:
+ path: /run
+ defaults:
+ _controller: Liip\MonitorBundle\Controller\HealthCheckController::runAllChecksAction
+
+liip_monitor_run_single_check:
+ path: /run/{checkId}
+ defaults:
+ _controller: Liip\MonitorBundle\Controller\HealthCheckController::runSingleCheckAction
+
+liip_monitor_list_reporters:
+ path: /list/reporters
+ defaults:
+ _controller: Liip\MonitorBundle\Controller\HealthCheckController::listReportersAction
diff --git a/Resources/config/runner.php b/Resources/config/runner.php
new file mode 100644
index 00000000..f50e3287
--- /dev/null
+++ b/Resources/config/runner.php
@@ -0,0 +1,12 @@
+parameters()
+ ->set('liip_monitor.runner.class', 'r');
+
+ $container->services()
+ ->set('liip_monitor.runner', \Liip\MonitorBundle\Runner::class)
+ ->public();
+};
diff --git a/Resources/config/runner.xml b/Resources/config/runner.xml
deleted file mode 100644
index 07940206..00000000
--- a/Resources/config/runner.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
- r
-
-
-
-
-
-
diff --git a/Resources/config/symfony_mailer.php b/Resources/config/symfony_mailer.php
new file mode 100644
index 00000000..9593657b
--- /dev/null
+++ b/Resources/config/symfony_mailer.php
@@ -0,0 +1,16 @@
+services()
+ ->set('liip_monitor.reporter.symfony_mailer', \Liip\MonitorBundle\Helper\SymfonyMailerReporter::class)
+ ->args([
+ service('mailer'),
+ param('liip_monitor.mailer.recipient'),
+ param('liip_monitor.mailer.sender'),
+ param('liip_monitor.mailer.subject'),
+ param('liip_monitor.mailer.send_on_warning'),
+ ])
+ ->tag('liip_monitor.additional_reporter', ['alias' => 'symfony_mailer']);
+};
diff --git a/Resources/config/symfony_mailer.xml b/Resources/config/symfony_mailer.xml
deleted file mode 100644
index 4881fc71..00000000
--- a/Resources/config/symfony_mailer.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-
- %liip_monitor.mailer.recipient%
- %liip_monitor.mailer.sender%
- %liip_monitor.mailer.subject%
- %liip_monitor.mailer.send_on_warning%
-
-
-
diff --git a/Tests/Check/RedisCollectionTest.php b/Tests/Check/RedisCollectionTest.php
index c74eb9f8..8843afab 100644
--- a/Tests/Check/RedisCollectionTest.php
+++ b/Tests/Check/RedisCollectionTest.php
@@ -38,7 +38,9 @@ private function assertAuthPropertyValue(Redis $check, string $auth): void
try {
$refClass = new \ReflectionClass($check);
$authProp = $refClass->getProperty('auth');
- $authProp->setAccessible(true);
+ if (\PHP_VERSION_ID < 80100) {
+ $authProp->setAccessible(true);
+ }
self::assertSame($auth, $authProp->getValue($check));
} catch (\ReflectionException $e) {
self::fail($e->getMessage());
diff --git a/Tests/DependencyInjection/Compiler/AddGroupsCompilerPassTest.php b/Tests/DependencyInjection/Compiler/AddGroupsCompilerPassTest.php
index c5392b3e..7f9482d9 100644
--- a/Tests/DependencyInjection/Compiler/AddGroupsCompilerPassTest.php
+++ b/Tests/DependencyInjection/Compiler/AddGroupsCompilerPassTest.php
@@ -7,6 +7,9 @@
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
+/**
+ * @group symfony8-incompatible
+ */
class AddGroupsCompilerPassTest extends AbstractCompilerPassTestCase
{
public function testProcess(): void
diff --git a/Tests/DependencyInjection/Compiler/AdditionalReporterCompilerPassTest.php b/Tests/DependencyInjection/Compiler/AdditionalReporterCompilerPassTest.php
index 6a1ffc83..ec43f187 100644
--- a/Tests/DependencyInjection/Compiler/AdditionalReporterCompilerPassTest.php
+++ b/Tests/DependencyInjection/Compiler/AdditionalReporterCompilerPassTest.php
@@ -10,6 +10,8 @@
/**
* @author Kevin Bond
+ *
+ * @group symfony8-incompatible
*/
class AdditionalReporterCompilerPassTest extends AbstractCompilerPassTestCase
{
diff --git a/Tests/DependencyInjection/Compiler/CheckCollectionTagCompilerPassTest.php b/Tests/DependencyInjection/Compiler/CheckCollectionTagCompilerPassTest.php
index c1a0b563..aade7332 100644
--- a/Tests/DependencyInjection/Compiler/CheckCollectionTagCompilerPassTest.php
+++ b/Tests/DependencyInjection/Compiler/CheckCollectionTagCompilerPassTest.php
@@ -11,6 +11,8 @@
/**
* @author Kevin Bond
+ *
+ * @group symfony8-incompatible
*/
class CheckCollectionTagCompilerPassTest extends AbstractCompilerPassTestCase
{
diff --git a/Tests/DependencyInjection/Compiler/CheckTagCompilerPassTest.php b/Tests/DependencyInjection/Compiler/CheckTagCompilerPassTest.php
index eddf277e..7500344f 100644
--- a/Tests/DependencyInjection/Compiler/CheckTagCompilerPassTest.php
+++ b/Tests/DependencyInjection/Compiler/CheckTagCompilerPassTest.php
@@ -11,6 +11,8 @@
/**
* @author Kevin Bond
+ *
+ * @group symfony8-incompatible
*/
class CheckTagCompilerPassTest extends AbstractCompilerPassTestCase
{
diff --git a/Tests/DependencyInjection/Compiler/GroupRunnersCompilerPassTest.php b/Tests/DependencyInjection/Compiler/GroupRunnersCompilerPassTest.php
index 3c8da4f7..c5776209 100644
--- a/Tests/DependencyInjection/Compiler/GroupRunnersCompilerPassTest.php
+++ b/Tests/DependencyInjection/Compiler/GroupRunnersCompilerPassTest.php
@@ -8,6 +8,9 @@
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
+/**
+ * @group symfony8-incompatible
+ */
class GroupRunnersCompilerPassTest extends AbstractCompilerPassTestCase
{
public function testProcess(): void
diff --git a/Tests/DependencyInjection/Compiler/MailerCompilerPassTest.php b/Tests/DependencyInjection/Compiler/MailerCompilerPassTest.php
index 09142f96..e276d883 100644
--- a/Tests/DependencyInjection/Compiler/MailerCompilerPassTest.php
+++ b/Tests/DependencyInjection/Compiler/MailerCompilerPassTest.php
@@ -10,6 +10,9 @@
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\Mailer\MailerInterface;
+/**
+ * @group symfony8-incompatible
+ */
class MailerCompilerPassTest extends AbstractCompilerPassTestCase
{
public function testDisabledMailer(): void
diff --git a/Tests/DependencyInjection/LiipMonitorExtensionTest.php b/Tests/DependencyInjection/LiipMonitorExtensionTest.php
index 36c7c7b8..c5339d59 100644
--- a/Tests/DependencyInjection/LiipMonitorExtensionTest.php
+++ b/Tests/DependencyInjection/LiipMonitorExtensionTest.php
@@ -43,6 +43,8 @@
/**
* @author Kevin Bond
+ *
+ * @group symfony8-incompatible
*/
class LiipMonitorExtensionTest extends AbstractExtensionTestCase
{
@@ -83,6 +85,10 @@ public function testChecksLoaded($name, $config, $checkClass, $checkAlias = null
$this->setExpectedException('InvalidArgumentException');
}
+ if ('security_advisory' === $name && !class_exists('Enlightn\SecurityChecker\AdvisoryAnalyzer')) {
+ $this->markTestSkipped('enlightn/security-checker is not installed (optional dependency).');
+ }
+
if (!$checkAlias) {
$checkAlias = $name;
}
diff --git a/Tests/Fixture/config_symfony8.yml b/Tests/Fixture/config_symfony8.yml
new file mode 100644
index 00000000..e7b34ba1
--- /dev/null
+++ b/Tests/Fixture/config_symfony8.yml
@@ -0,0 +1,12 @@
+# Symfony 8 config (same structure as 7.x)
+framework:
+ router:
+ resource: "%kernel.project_dir%/routing.yml"
+ secret: test
+ test: ~
+ assets: ~
+ profiler:
+ collect: false
+
+liip_monitor:
+ enable_controller: true
diff --git a/UPGRADE.md b/UPGRADE.md
index 49b2a112..9e37a3f3 100644
--- a/UPGRADE.md
+++ b/UPGRADE.md
@@ -1,3 +1,24 @@
+## Upgrade to next version (Symfony 8 / XML deprecation)
+
+### [BC BREAK] Bundle routes file extension changed
+
+If you import the bundle routes manually, update the resource path from `routing.xml` to `routing.yaml`:
+
+```yaml
+# Before
+_monitor:
+ resource: "@LiipMonitorBundle/Resources/config/routing.xml"
+
+# After
+_monitor:
+ resource: "@LiipMonitorBundle/Resources/config/routing.yaml"
+```
+
+The bundle's internal service configuration has been migrated from XML to PHP (Symfony 7.4+ deprecation).
+This only affects the routing file if you reference it explicitly; the bundle routes themselves are unchanged.
+
+---
+
## Upgrade from 2.11 to 2.12
### [Possible BC BREAK] Switch to `laminas/laminas-diagnostics`
diff --git a/composer.json b/composer.json
index af0c305e..8cdf1b58 100644
--- a/composer.json
+++ b/composer.json
@@ -5,51 +5,45 @@
"keywords": ["monitoring", "monitor", "check", "health"],
"license": "MIT",
"authors": [
- {
- "name": "Alvaro Videla",
- "email": "alvaro.videla@liip.ch"
- },
- {
- "name": "Kevin Bond",
- "homepage": "https://zenstruck.com/"
- },
- {
- "name": "Liip AG",
- "homepage": "https://www.liip.ch/"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://github.com/liip/LiipMonitorBundle/contributors"
- }
+ {"name": "Alvaro Videla", "email": "alvaro.videla@liip.ch"},
+ {"name": "Kevin Bond", "homepage": "https://zenstruck.com/"},
+ {"name": "Liip AG", "homepage": "https://www.liip.ch/"},
+ {"name": "Symfony Community", "homepage": "https://github.com/liip/LiipMonitorBundle/contributors"}
],
"require": {
"php": "^8.1",
- "symfony/framework-bundle": "^6.4|^7.0",
- "laminas/laminas-diagnostics": "^1.9"
+ "symfony/framework-bundle": "^6.4|^7.0|^8.0",
+ "laminas/laminas-diagnostics": "^1.27"
},
"require-dev": {
- "doctrine/doctrine-migrations-bundle": "^2.0 || ^3.0 || ^7.0",
- "doctrine/migrations": "^2.0 || ^3.0",
- "doctrine/persistence": "^1.3.3 || ^2.0 || ^3.0",
- "enlightn/security-checker": "^1.11",
+ "doctrine/doctrine-migrations-bundle": "^2.0 || ^3.0 || ^7.0 || ^4.0",
+ "doctrine/migrations": "^2.0 || ^3.0 || ^4.0",
+ "doctrine/persistence": "^1.3.3 || ^2.0 || ^3.0 || ^4.0",
"guzzlehttp/guzzle": "^5.3.2 || ^6.3.3 || ^7.0.1",
"matthiasnoback/symfony-dependency-injection-test": "^4.3 || ^5.0",
"php-cs-fixer/shim": "^3.75",
"phpunit/phpunit": "^9.6.23",
- "symfony/asset": "^6.4|^7.0",
- "symfony/browser-kit": "^6.4|^7.0",
- "symfony/expression-language": "^6.4|^7.0",
- "symfony/finder": "^6.4|^7.0",
- "symfony/mailer": "^6.4|^7.0",
- "symfony/messenger": "^6.4|^7.0",
- "symfony/phpunit-bridge": "^7.3",
- "symfony/twig-bundle": "^6.4|^7.0"
+ "symfony/asset": "^6.4|^7.0|^8.0",
+ "symfony/browser-kit": "^6.4|^7.0|^8.0",
+ "symfony/expression-language": "^6.4|^7.0|^8.0",
+ "symfony/finder": "^6.4|^7.0|^8.0",
+ "symfony/mailer": "^6.4|^7.0|^8.0",
+ "symfony/messenger": "^6.4|^7.0|^8.0",
+ "symfony/phpunit-bridge": "^7.3|^8.0",
+ "symfony/twig-bundle": "^6.4|^7.0|^8.0",
+ "symfony/yaml": "^6.4|^7.0|^8.0"
+ },
+ "scripts": {
+ "test": ["phpunit"]
},
"suggest": {
- "symfony/expression-language": "To use the Expression check"
+ "symfony/expression-language": "To use the Expression check",
+ "enlightn/security-checker": "Required by the Security Advisory check (^1.11; not yet compatible with Symfony 8)"
},
"autoload": {
- "psr-4": { "Liip\\MonitorBundle\\": "" }
+ "psr-4": {
+ "Liip\\MonitorBundle\\": ""
+ }
},
"config": {
"preferred-install": "dist",
diff --git a/docker-compose.yml b/docker-compose.yml
new file mode 100644
index 00000000..8fbf68a9
--- /dev/null
+++ b/docker-compose.yml
@@ -0,0 +1,12 @@
+services:
+ php:
+ build: .
+ volumes:
+ - .:/app
+ working_dir: /app
+ environment:
+ - KERNEL_CLASS=Liip\MonitorBundle\Tests\Fixture\AppKernel
+ - SYMFONY_DEPRECATIONS_HELPER=max[self]=0&max[direct]=0&quiet[]=indirect&quiet[]=other
+ stdin_open: true
+ tty: true
+ command: sh
diff --git a/phpunit-symfony8.xml.dist b/phpunit-symfony8.xml.dist
new file mode 100644
index 00000000..0ca4b2ff
--- /dev/null
+++ b/phpunit-symfony8.xml.dist
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
+
+
+ Tests/Check
+ Tests/Helper
+ Tests/LiipMonitorBundleTest.php
+ Tests/RunnerTest.php
+
+
+
+
+
+
+