-
Notifications
You must be signed in to change notification settings - Fork 23
Description
I've noticed that I get this fatal error when running WP-CLI commands in SOME folders:
`Fatal error: Uncaught Error: Class "SimpleLocator\Bootstrap" not found in /sites/theridgepro/files/web/app/plugins/simple-locator/app/SimpleLocator.php:17
Stack trace:
#0 /sites/theridgepro/files/web/app/plugins/simple-locator/simplelocator.php(51): SimpleLocator::init()
#1 /sites/theridgepro/files/web/wp/wp-settings.php(447): include_once('...')
#2 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1317): require('...')
#3 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1235): WP_CLI\Runner->load_wordpress()
#4 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LaunchRunner.php(28): WP_CLI\Runner->start()
#5 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/bootstrap.php(78): WP_CLI\Bootstrap\LaunchRunner->process()
#6 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/wp-cli.php(27): WP_CLI\bootstrap()
#7 phar:///usr/local/bin/wp/php/boot-phar.php(11): include('...')
#8 /usr/local/bin/wp(4): include('...')
#9 {main}
thrown in /sites/theridgepro/files/web/app/plugins/simple-locator/app/SimpleLocator.php on line 17`
For example, I'm running Bedrock. In the root folder (not the web-facing folder), if I try to run wp plugin list it will throw the error.
However, if I move to the "web" folder (and deeper), the command will run.
But, if I run wp core version it works in all the folders.
I think it has to do with autoloading PHP namespaces, but I'm not 100% certain, as I don't have enough experience with that. Certain WP CLI commands probably are running more parts of Wordpress, like plugin loaders, and there happens to be a conflict with Simple Locator.
I use WP CLI a LOT, and have never had this problem before with any other plugins.
Thanks for your attention! I'm happy to help troubleshoot/test this further.