mogilvie / EncryptBundle

Encryption bundle
82 stars 27 forks source link

The package expects a Doctrine connection named `default` #46

Closed EmilePerron closed 1 month ago

EmilePerron commented 11 months ago

Hi there!

Just wanted to try out the package as the multi-connection support was interesting for the project I'm working on, and I had the following error pop up when running the package's recipe upon composer install:

!!    In RegisterEventListenersAndSubscribersPass.php line 91:
!!                                                                                 
!!    The Doctrine connection "default" referenced in service "SpecShaper\Encrypt  
!!    Bundle\Subscribers\DoctrineEncryptSubscriber" does not exist. Available con  
!!    nections names: "regional", "core".  

As you can see, neither of our connections are named "default", which crashes the app until the connections are defined in the configuration.

I don't have time for a PR on this at this very moment, but I expect looking at the doctrine.dbal.default_connection configuration could fix this issue, in order to make the install process smoother.

If I get some time to look into it before you do I might just make a PR for it.

Cheers! :)

mogilvie commented 1 month ago

Thanks, I took a look into this, and have decided it makes the package overly complicated to try and find the default connection. Any solution for defining a default eventually resulted in some other configuration parameter being required. If you're not using 'default', then just define the connection name it into the configuration parameters for the package.