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

conflict in storage composer.json between specified versions of phpdocumentor and twig #13699

Closed
scottw-finao opened this issue Feb 19, 2024 · 6 comments

Comments

@scottw-finao
Copy link

scottw-finao commented Feb 19, 2024

What version of OpenCart are you reporting this for?

v4.0.2.3

Describe the bug

unable to run composer update in storage directory due to conflict in composer.json between phpdocumentor and twig.

What section does it affect?

storage vendor files

To Reproduce

  1. Fresh install
    1b (create storage)
  2. open command line
  3. cd to storage directory
  4. run composer update

Expected behavior
composer checks for possible updates, rebuilds autoload files, etc.

Screenshots / Screen recordings

$ composer update
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires phpdocumentor/phpdocumentor 3.3.1 -> satisfiable by phpdocumentor/phpdocumentor[v3.3.1].
    - phpdocumentor/phpdocumentor v3.3.1 requires twig/twig ~2.0 -> found twig/twig[v2.0.0, ..., v2.16.0] but it conflicts with your root composer.json require (^3.3.7).

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

Server / Test environment (please complete the following information):
apche 2.4.52 on ubuntu 22.0.4.4 with php 8.2.15

Additional context

I was looking to install another dependency to utilize .env configuration files. Before doing a composer require, I ran a simple update and it errored out as above. I have tried various versioning of phpdocumentor with no luck.

@scottw-finao
Copy link
Author

With more digging, i think this may be related to the import/export module installed from the marketplace. Going over there to check for possible bugs listed.

@danielkerr
Copy link
Member

any replacement out there for phpdocs since it seems its noot updated

@scottw-finao
Copy link
Author

I did a fresh install to test without adding any extensions and confirmed it does it out-of-the-gate with a fresh install.

@scottw-finao
Copy link
Author

scottw-finao commented Feb 19, 2024

I got a suggestion from the folks over at phpdocumentor:

phpdocumentor github issues #3673

What I basically did was replace the phpdocumenter line in composer.json with the shim require and it seems to have solved that issue (allows composer update to complete and doesn't immediately generate errors loading opencart in a browser), but that pops up another issue after composer completes.

The system/vendor.php seems to be looking for guzzlehttp/promises/src/functions_include.php but after running composer update, that file no longer exists in vendor/guzzlehttp/promises/src

EDIT:
It looks like composer update replaces 1.5.x with a 2.x version of guzzlehttp/promises which no longer includes the functions_include.php -- there is a similar line for guzzlehttp/guzzle but that package/version still has the functions_include.php file.
For the moment, I commented out the require line immediately under promises in vendor.php and will see if it creates any problems. (assuming it does, I may need to manually specify versions of guzzle in the storage/composer.json and/or individually register autoloader entries for whatever objects are being looked for)

@scottw-finao
Copy link
Author

Out of curiosity, is there an RFC or white paper anywhere that describes why they use the vendor.php for composer files? Now that I have that folder loading properly, I found I was able to basically comment out the entire vendor.php file and just use a single require_once(DIR_STORAGE.'vendor/autoload.php'); line and it appears to work as designed.

I get having the ability to add non-composer libs or directories. (I notice there is a system and an extension already loaded in the autoloader before vendor.php is called) but for composer stuff, why not just use the composer autoloader?

@danielkerr
Copy link
Member

phpdocumentor is removed from lastest

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

No branches or pull requests

2 participants