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

Cannot install CompatInfo as a vendor dependency #313

Closed LucasKovacs closed 2 years ago

LucasKovacs commented 2 years ago

Bug report

OS

  1. Host operating system and version: ubuntu 20.10

  2. PHP version: PHP 8.0.8 (cli) (built: Oct 26 2021 11:42:42) ( NTS ) Copyright (c) The PHP Group Zend Engine v4.0.8, Copyright (c) Zend Technologies with Zend OPcache v8.0.8, Copyright (c), by Zend Technologies

  3. PHP CompatInfo version: 6.0.1

  4. What git commit hash are you on?: latest

  5. PHP extensions loaded? Uses either reference:list or db:list command depends on CompatInfo version: I can't run any command because of the issue

Summary

PHP Fatal error:  Uncaught Symfony\Component\Config\Exception\FileLocatorFileNotFoundException: The file "/home/system/vendor/bartlett/php-compatinfo/vendor/bartlett/php-compatinfo-db/config/set/default.php" does not exist. in /home/system/vendor/symfony/config/FileLocator.php:44

Other information

full command is: vendor/bin/phpcompatinfo analyser:run ./src checked and the file is located at vendor/bartlett/php-compatinfo-db/config/set/default.php

llaville commented 2 years ago

Bugfix release 6.0.2 is on way. Will come in few hours because I'm busy now !

But if you want to try the fix, then you should do :

For example : on empty folder /shared/backups/github/compatinfo-313

devilbox@php-7.4.27 in /shared/backups/github/compatinfo-313 $ tree -L 1
.
├── composer.json
├── composer.lock
└── vendor

1 directory, 2 files
return static function (ContainerConfigurator $containerConfigurator): void {
    if (file_exists(dirname(__DIR__, 2) . '/vendor')) {
        $configSet = dirname(__DIR__, 2) . '/vendor/bartlett/php-compatinfo-db/config/set/default.php';
    } else {
        $configSet = dirname(__DIR__, 3) . '/php-compatinfo-db/config/set/default.php';
    }
    $containerConfigurator->import($configSet);
    $containerConfigurator->import(__DIR__ . '/common.php');
    $containerConfigurator->import(__DIR__ . '/../packages/messenger.php');
devilbox@php-7.4.27 in /shared/backups/github/compatinfo-313 $ cd vendor/bartlett/php-compatinfo-db/

devilbox@php-7.4.27 in /shared/backups/github/compatinfo-313/vendor/bartlett/php-compatinfo-db $ composer run setup-database

devilbox@php-7.4.27 in /shared/backups/github/compatinfo-313/vendor/bartlett/php-compatinfo-db $ ../../bin/doctrine orm:schema-tool:create

devilbox@php-7.4.27 in /shared/backups/github/compatinfo-313/vendor/bartlett/php-compatinfo-db $ bin/compatinfo-db db:init
devilbox@php-7.4.27 in /shared/backups/github/compatinfo-313/vendor/bartlett/php-compatinfo-db $ cd ../../..

And use PHP_CompatInfo v6 !

llaville commented 2 years ago

Affect also version 5.5 : so a bugfix 5.5.5 is planned too

llaville commented 2 years ago

Releases 5.5.5 and 6.0.2 are now available. I've run tests in real condition, as explained above, to setup database, and all LGTM !

llaville commented 2 years ago

@LucasKovacs Thanks for reporting !