-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Annotations cannot be enabled error occurs when installing anything requiring doctrine/annotations. #24683
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
Comments
Are you sure that this is really related to this installation and not a consequence of a previously failing run (e.g. symfony/flex#194)? I don't see why the annotation cache should be enabled in the config just by the command you were running. |
Yes I'm sure. I actually deleted the entire vendor dir, made sure composer.lock was back at it's previous state, aka it's definitely enabled. I see it's happening because of the default configuration. If I put I also tested it to make sure: $ composer create-project -s beta symfony/skeleton:4.0.x test
$ cd test
$ composer require --dev friendsofphp/php-cs-fixer:2.7.x-dev |
Looks like fix for this recently landed to master #24658 |
That simply adds |
This looks like a legit bug to me. As soon as the Annotations class is available, the annotations system defaults to enabled. But, then the default cache is php_array, which causes this error. It seems to me that is the presence of the annotations lib activates the annotation system, and because doctrine/cache is optional, it should not fail if it is not there. I think we should default to “none” cache if Doctrine/cache is not present. See the Configration class. |
Anyone willing to work on a PR to fix this one? |
Fixed in #24743 |
…cache is not present (sroze) This PR was merged into the 3.4 branch. Discussion ---------- [FrameworkBundle] Do not activate the cache if Doctrine's cache is not present | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #24683 | License | MIT | Doc PR | ø Annotations are automatically enabled when the `doctrine/annotations` package is around. These annotations are enabled with the `php_array` cache by default, which require `doctrine/cache`. This PR allow this scenario to happen by disabling the annotation cache when `doctrine/cache` is not present. Commits ------- c5c7a23 Do not activate the cache if Doctrine's cache is not present
When running
composer require friendsofphp/php-cs-fixer:2.7-x-dev
on Symfony 4, I get the following:This is a problem in my opinion because installing php-cs-fixer shouldn't require additional packages to make the framework work when I have specifically not installed annotations using flex.
On a related note, it only reverts
composer.json
, but does not remove the auto-generated.php_cs.dist
, changes to.gitignore
nor the changes tocomposer.lock
.The text was updated successfully, but these errors were encountered: