RamyHakam / multi_tenancy_bundle

Symfony 5 /6 bundle to support multi-tenants
MIT License
70 stars 24 forks source link

Running into connection issues #3

Closed vmdumitrache closed 1 year ago

vmdumitrache commented 1 year ago

Hi,

First things first, thank you very much for creating and sharing this bundle! It's something I've been looking for quite a while, and I'm finding it quite useful.

I've created a PR with some updates for this bundle.

I noticed that whenever I create a SwitchDbEvent, I get an exception, informing me that access is denied for '':''@172.18.0.5. I believe that 172.18.0.5 comes from the fact that I'm using Docker, but it's not the correct one for the MySQL container hostname I had specified in the configuration.

All of the parameters in hakam_multi_tenancy.yaml were configured correctly, both based on the README and from what I could gather following your YouTube tutorials (awesome work, by the way, even though I couldn't understand a word).

Debugging the code, I noticed that parameters for /Doctrine/DBAL/Driver::connect() were set differently when the default Doctrine connection was used then when it got updated it TenantConnection::connect(). I modified the latter such that it takes all parameters and it appears to work correctly.

In addition to this, I've made some changes so that multi_tenancy_bundle.url and multi_tenancy_bundle.port can be used.

Any feedback is immensely appreciated!

RamyHakam commented 1 year ago

Thank you very much for your words , I really appreciate that Regrading the issue and improvements you made its very interesting and i will check it and back to you for sure