Skip to content

Commit

Permalink
Require project autoloader in wp-cli.yml (#636)
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanclevenger91 authored Apr 24, 2024
1 parent 21665b0 commit 566407b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions wp-cli.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
path: web/wp
require:
- vendor/autoload.php
server:
docroot: web

4 comments on commit 566407b

@LucasDemea
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This causes me an error when I run any wp cli command:

Fatal error: Declaration of Illuminate\Container\Container::get(string $id) must be compatible with Psr\Container\ContainerInterface::get($id) in /srv/www/bedrock-ds/current/vendor/illuminate/container/Container.php on line 739

I'm using latest acorn

@ethanclevenger91
Copy link
Contributor Author

@ethanclevenger91 ethanclevenger91 commented on 566407b Jun 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are your other dependencies and plugins? The Psr\Container\ContainerInterface signature was updated in v1.1.0 of psr/container, and you shouldn't actually be able to install a version older than that alongside illuminate/container:^11.0. Some other dependency (more likely a plugin) may be breaking this by bundling a really old version of psr/container.

@retlehs
Copy link
Member

@retlehs retlehs commented on 566407b Jul 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ethanclevenger91
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@retlehs So the conflict is with the global WP-CLI install and its dependency on psr/container, not any two dependencies within the WordPress project, right? I guess I would think that anytime Acorn was loaded in the context of a WP-CLI command this would happen, but I'm clearly missing something.

Please sign in to comment.