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
Fatal error if composer prepend-autoloader is set to false #1497
Comments
|
Here's what's happening:
I wonder if this is a composer bug in that the loading of \Composer\Autoload\ClassLoader should not be controlled by prepend-autoloader. |
legoktm
added a commit
to legoktm/PHP_CodeSniffer
that referenced
this issue
Jun 29, 2017
If the composer autoloader has prepend-autoloader: false set, the PHPCS autoloader will take priority over the composer autoloader, and composer will have trouble autoloading its own autoloader. Avoid all of that by simply not trying to load any classes that are under the "Composer" namespace. Fixes squizlabs#1497
legoktm
added a commit
to legoktm/PHP_CodeSniffer
that referenced
this issue
Jun 29, 2017
If the composer autoloader has prepend-autoloader: false set, the PHPCS autoloader will take priority over the composer autoloader, and composer will have trouble autoloading its own autoloader. Avoid all of that by simply not trying to load any classes that are under the "Composer" namespace. Fixes squizlabs#1497
legoktm
added a commit
to legoktm/PHP_CodeSniffer
that referenced
this issue
Jul 6, 2017
If the composer autoloader has prepend-autoloader: false set, the PHPCS autoloader will take priority over the composer autoloader, and composer will have trouble autoloading its own autoloader. Avoid all of that by simply not trying to load any classes that are under the "Composer" namespace. Fixes squizlabs#1497
|
bump. @gsherwood hi, could you take a look at this please? |
|
Fixed via PR #1536 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To reproduce, create a composer.json with:
Run
composer install. Then tryvendor/bin/phpcs --version. I get the following output:I found this when testing upgrading MediaWiki's CodeSniffer ruleset to 3.0. MediaWiki sets prepend-autoloader: false for performance reasons since most of our autoloaded classes are in MediaWiki's autoloader, not composer's.
The text was updated successfully, but these errors were encountered: