-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Apcu cache is used even if it is not enabled #10310
Labels
Comments
The proposed solution looks good to me, PR welcome. |
aleksejs1
pushed a commit
to aleksejs1/orm
that referenced
this issue
Dec 15, 2022
aleksejs1
pushed a commit
to aleksejs1/orm
that referenced
this issue
Dec 15, 2022
aleksejs1
pushed a commit
to aleksejs1/orm
that referenced
this issue
Dec 15, 2022
derrabus
pushed a commit
that referenced
this issue
Dec 18, 2022
* add apcu enabled check if apcu extension loaded (#10310) * Apply suggestions from code review Co-authored-by: Grégoire Paris <[email protected]> * add use function apcu_enabled * enable apcu_cli for cache tests Co-authored-by: Aleksejs Kovalovs <[email protected]> Co-authored-by: Grégoire Paris <[email protected]>
derrabus
added a commit
to derrabus/orm
that referenced
this issue
Dec 19, 2022
* 2.14.x: Drop forceful loading of annotations (doctrine#10321) Document stdClass structures used by CommitOrderCalculator (doctrine#10315) Psalm 5.3.0 (doctrine#10317) PHPStan 1.9.4 (doctrine#10318) add apcu enabled check if apcu extension loaded (doctrine#10310) (doctrine#10311) Add TypedFieldMapper for automatic mapping of typed PHP fields to DBAL types (doctrine#10313)
derrabus
added a commit
to derrabus/orm
that referenced
this issue
Dec 19, 2022
* 2.14.x: Drop forceful loading of annotations (doctrine#10321) Document stdClass structures used by CommitOrderCalculator (doctrine#10315) Psalm 5.3.0 (doctrine#10317) PHPStan 1.9.4 (doctrine#10318) add apcu enabled check if apcu extension loaded (doctrine#10310) (doctrine#10311) Add TypedFieldMapper for automatic mapping of typed PHP fields to DBAL types (doctrine#10313)
Fixed by #10311, right? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug Report
Summary
In case of apcu extension exists, but not enabled Doctrine/ORM/Tools::createCacheInstance still creates ApcuCache or ApcuAdapter.
When someone try to write the cache "Failed to save key xxx of type Doctrine\ORM\Mapping\ClassMetadata." error appears.
Current behavior
When someone try to write the cache "Failed to save key xxx of type Doctrine\ORM\Mapping\ClassMetadata." error appears.
How to reproduce
Just an example:
Make the environment with existed disabled apcu extension.
Create doctrine migration with entityManager dependency.
Run doctrine:migration:status in cli.
Got "Failed to save key xxx of type Doctrine\ORM\Mapping\ClassMetadata." error.
Solution options
Change if statement in https://github.com/doctrine/orm/blob/2.13.x/lib/Doctrine/ORM/Tools/Setup.php#L239
from
} elseif (extension_loaded('apcu')) {
to
} elseif (extension_loaded('apcu') && apcu_enabled()) {
or
} elseif (extension_loaded('apcu') && ini_get('apc.enabled')) {
The text was updated successfully, but these errors were encountered: