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
371 stars 21 forks source link

[ERROR] Lazy ghost objects cannot be enabled... #365

Closed remicollet closed 8 months ago

remicollet commented 9 months ago

Running with PHP 8.2 (but trying to make a 8.0 compatible archive)

$ composer config platform.php 8.0.99

$ composer install --no-interaction --no-progress --no-dev --optimize-autoloader

$ bin/phpcompatinfo --version

 [ERROR] Lazy ghost objects cannot be enabled because the "symfony/var-exporter" library version 6.2 or higher is not   
         installed. Please run "composer require symfony/var-exporter:^6.2".                                            

Switching to PHP 8.1 (so from Symfony 6.0 to 6.4) is a workaround

llaville commented 9 months ago

If you run phpcompatinfo 7.0.2 on a PHP 8.0 platform, CompatInfoDB 5.14.1 will be installed and lazy ghost objects Doctrine feature will be disabled. See https://github.com/llaville/php-compatinfo-db/commit/2718e7e7dc2d571ebbd9ccc6bff6a7d19dadea2d

composer require bartlett/php-compatinfo ^7 --no-interaction --no-progress --optimize-autoloader
vendor/bin/phpcompatinfo --version
7.0.2@cff8a7a

vendor/bin/phpcompatinfo about

phpCompatInfo version 7.0.2@cff8a7a DB version 5.14.1@43af63d
Please visit https://llaville.github.io/php-compatinfo/6.x/ for more information.

NOTE: I just see a bug here (link is wrong) identify a 6.x rather than 7.0 => fixed by commit https://github.com/llaville/php-compatinfo/commit/8567c38dd25fbb0e73da87c85f99faa15bef125d

remicollet commented 9 months ago

If you run phpcompatinfo 7.0.2 on a PHP 8.0 platform, CompatInfoDB 5.14.1 will be installed and lazy ghost objects Doctrine feature will be disabled.

But if you install PHP 8.0+ compatible version (composer config platform.php 8.0.99) so with CompatInfoDB 5.14.1 and Symfony 6.0, when running it with 8.2, it will try to enable lazy ghost, which requires Symfony 6.2

remicollet commented 9 months ago

BTW, only to report, I don't care anymore as I drop support for 8.0 in the RPM

remicollet commented 9 months ago

And FYI, also sometime got

$ bin/phpcompatinfo --version

 [ERROR] Too few arguments to function                                                                                  
         Bartlett_CompatInfo_Application_Kernel_ConsoleKernelProdContainer::getApplicationInterface2Service(), 0 passed 
         in /tmp/php-compatinfo/vendor/symfony/dependency-injection/Container.php on line 217 and exactly 1 expected    
llaville commented 9 months ago

I've just keep a chance to CompatInfo 7.0 users to use the recent database contents (v6..0), but I'm not in favour to keep compatibility with old components no more supported :

llaville commented 9 months ago

And FYI, also sometime got

$ bin/phpcompatinfo --version

 [ERROR] Too few arguments to function                                                                                  
         Bartlett_CompatInfo_Application_Kernel_ConsoleKernelProdContainer::getApplicationInterface2Service(), 0 passed 
         in /tmp/php-compatinfo/vendor/symfony/dependency-injection/Container.php on line 217 and exactly 1 expected    

You should perharps removed SF container cache files

llaville commented 8 months ago

Release 7.1.0 is on way !