OpenConext / OpenConext/Monitor-bundle

Make `doctrine/dbal` an optional or suggested package

Open
#26 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
6
Forks
2
Avg merge
17d 43m
Merged PRs (30d)
1

Description

Currently, when using this bundle, it adds a composer dependency, doctrine/dbal. However, some projects, like stepup-azuremfa, do not use a database.
But the monitor bundle causes doctrine/dbal to be installed in those projects.

This is not really a problem, as the connection is optional in the DoctrineConnectionHealthCheck.

        if ($this->connection === null) {

But it would be nice to not packages without reason.

Possible solution:

  1. Move doctrine/dbal from require to suggest in composer.json.
  2. Exclude DoctrineConnectionHealthCheck.php from resource discovery in services.yaml to prevent autoloading errors?
  3. Conditionally register DoctrineConnectionHealthCheck in OpenConextMonitorBundle.php only if Doctrine\DBAL\Connection exists.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review composer.json, services.yaml, OpenConextMonitorBundle.php, and DoctrineConnectionHealthCheck.php to compare the proposed ways of making doctrine/dbal optional. Start by tracing service resource discovery and bundle registration without the package installed. Done means projects without a database no longer install doctrine/dbal and do not encounter autoloading or registration errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.