llaville / php-compatinfo

Library that find out the minimum version and the extensions required for a piece of code to run
https://llaville.github.io/php-compatinfo/7.1/
Other
372 stars 20 forks source link

regression: DATABASE_URL from env doesn't work in new 6.5.x #356

Closed remicollet closed 2 years ago

remicollet commented 2 years ago

Was working as expected in 6.4.x

$ phpcompatinfo diagnose
    ...
    >  [env(APP_DATABASE_URL)] sqlite:////usr/share/php-bartlett-PHP-CompatInfo/data/compatinfo-db.sqlite
    ....

First call is OK

$ export DATABASE_URL=sqlite:////tmp/compatinfo-db.sqlite
$ phpcompatinfo diagnose
    ...
    >  [env(APP_DATABASE_URL)] sqlite:////usr/share/php-bartlett-PHP-CompatInfo/data/compatinfo-db.sqlite
    ....

Second call is broken, DATABASE_URL env is ignored

Workaround

$ rm -rf ~/.cache/bartlett/
$ phpcompatinfo diagnose
    ...
    >  [env(APP_DATABASE_URL)] sqlite:////tmp/compatinfo-db.sqlite
    ....

So... cache issue.

So, this is a regression (tested with 6.5.1)

llaville commented 2 years ago

So... cache issue.

So, this is a regression (tested with 6.5.1)

I confirm it's a Symfony Container Compiled cache issue on my side. Good catch @remicollet ! I'll fix it tomorrow morning, because I've not enough time tonight.

llaville commented 2 years ago

As it's related to database, the fix will be applied on PHP_CompatInfoDB.

FYI: as I've also some minor changes to do on CompatInfo, I'll also release a bugfix 6.5.2

llaville commented 2 years ago

@remicollet FYI :

I'll release both CompatInfoDB 4.6.1 and CompatInfo 6.5.2 in few hours unless we found another critical issue (but I don't think so ;-)

llaville commented 2 years ago

Versions CompatInfoDB 4.6.1 and CompatInfo 6.5.2 are now available.