Class "Composer\Command\BaseCommand" not found |
I'm using pest framework for testing, however, when pest is installed, the subject of this thread prevent `php spark` command to run. Trace:
Code: CodeIgniter v4.2.4 Command Line Tool - Server Time: 2022-08-21 16:36:53 UTC-05:00
Is this a bug in pest?
@kenjis This is a framework bug.
If the search for modules in the composer is enabled in the config, the namespaces of the installed packages are saved. When searching for a command, all namespaces are checked and Commands/ is appended to the namespace directory path. Therefore, the VENDORPATH\pestphp\pest-plugin\src\Commands\ directory is scanned. The Composer\Command\BaseCommand namespace is Composer's internal namespace, and as I understand it (not sure) it is available only when accessing composer.phar, that is, through the CLI. Therefore, an error occurs. I believe that this is not only related to commands. If the composer package contains a Config directory with {Routes, Events, Services, Filters, Registrar}.php files or a Helpers/{helpername}.php directory This may break the application. (09-03-2022, 05:18 AM)iRedds Wrote: The Composer\Command\BaseCommand namespace is Composer's internal namespace, and as I understand it (not sure) it is available only when accessing composer.phar, that is, through the CLI. The package is a Composer plugin? So it depends on Composer\Command\BaseCommand. Yes, the class is not accessible from spark.
Since v4.3, you can configure Composer packages to discover manually.
See https://github.com/codeigniter4/CodeIgniter4/pull/6503 |
Welcome Guest, Not a member yet? Register Sign In |