Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot install CompatInfo as a vendor dependency #313

Closed
LucasKovacs opened this issue Dec 26, 2021 · 4 comments
Closed

Cannot install CompatInfo as a vendor dependency #313

LucasKovacs opened this issue Dec 26, 2021 · 4 comments
Assignees
Labels

Comments

@LucasKovacs
Copy link

LucasKovacs commented Dec 26, 2021

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 llaville self-assigned this Dec 27, 2021
@llaville llaville added the bug label Dec 27, 2021
@llaville llaville changed the title Error while trying to run the analyzer Cannot install CompatInfo as a vendor dependency Dec 27, 2021
@llaville
Copy link
Owner

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

  • install php-compatinfo 6.0.1 as a vendor dependency : composer require bartlett/php-compatinfo
devilbox@php-7.4.27 in /shared/backups/github/compatinfo-313 $ tree -L 1
.
├── composer.json
├── composer.lock
└── vendor

1 directory, 2 files
  • checks composer.json contents
devilbox@php-7.4.27 in /shared/backups/github/compatinfo-313 $ cat composer.json
{
    "require": {
        "bartlett/php-compatinfo": "^6.0"
    }
}
  • apply fix on /shared/backups/github/compatinfo-313/vendor/bartlett/php-compatinfo/config/set/default.php
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');

  • configure the database
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
  • return to your project root
devilbox@php-7.4.27 in /shared/backups/github/compatinfo-313/vendor/bartlett/php-compatinfo-db $ cd ../../..

And use PHP_CompatInfo v6 !

@llaville
Copy link
Owner

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

llaville added a commit that referenced this issue Dec 27, 2021
* fix issue #313 for branch 5.5 of CompatInfo
* fix Composer 2.2 compatibility for plugins
@llaville
Copy link
Owner

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
Copy link
Owner

@LucasKovacs Thanks for reporting !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants