Closed (fixed)
Project:
Drupal core
Version:
8.8.x-dev
Component:
cache system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
31 May 2019 at 16:09 UTC
Updated:
6 Aug 2019 at 19:59 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
berdirComment #3
fconnolly commentedI'm going to take a swing at this. Should the class be replaced by anything in ApcuBackendFactory? Or should an error be raised?
Comment #4
fconnolly commentedComment #5
cilefen commented@fconnolly: see https://www.drupal.org/core/deprecation
Comment #6
fconnolly commentedI've uploaded a test patch. I believe I've deprecated the class the correct way, and that is the only change I've made. However, the project does not pass the tests on my local machine. I don't believe that just deprecating a function should break any tests? So I'm uploading for feedback/clarification. I also have not changed any of the actual code in Apcu4BackendFactory as I couldn't properly test any of my changes
Comment #7
berdirNot sure which tests you did run, but this would only be loaded on PHP 5, if tests failed that might have had other reasons.
The other thing you need to do is remove the code in ApcuBackendFactory that conditionally uses this class.
Comment #8
fconnolly commentedI've removed the conditional usage in ApcuBackendFactory. Also just to clarify, Apcu v4 would only be used if the user has PHP 5 or less, and Drupal 8.8.x no longer supports PHP 5, so it's safe to remove it?
Also, I tried looking in the composer.json file a little bit and didn't see anything about apcu v4, but do we need to including the apcu v4 extension somewhere in the source code?
Comment #9
fconnolly commentedFixed a coding style error. Also updated the ApcuBackendTest class, didn't realize it tested the version separately instead of using the factory
Comment #10
fconnolly commentedRemoved use statement from ApcuBackendtest
Comment #11
fconnolly commentedComment #12
fconnolly commentedComment #13
berdirlooks like you included the older patch files into the patch.
Comment #14
fconnolly commentedAh, sorry, it's my first time using patches, I committed the older patch files in the issue branch. Fixed. Thanks for your patience
Comment #15
fconnolly commentedComment #17
fconnolly commentedComment #18
berdirThe code changes themself look good, but we need to improve wording and spacing a bit here.
Id' keep the @trigger_error() on a single line, even if it is long.
The part inside the docblock with @deprecated must not be more than 80 characters however and needs a line break earlier.
We should also have an empty line above the @deprecated and above the @see. and the @see needs to use the full namespace.
I fear we also have pretty strict rules on having change records, even when there's really nothing else to say, so we need to create one with the add link on https://www.drupal.org/list-changes/drupal. And then link to that in the @see below and with See ...
I'm not sure if we need the part with "Apcu 4 was built..", I'd just leave that out. Suggestion: ...\Apcu4Backend is deprecated in drupal:8.8.0 and will be removed from drupal:9.0.0. Use ApcuBackend instead. See link-to-change-record"
Same text for @deprecated, except there the See link part is a separate @see.
Comment #19
leolandotan commentedI'll try to work on this and create an initial change record as well.
Comment #20
leolandotan commentedI added the "Needs change record" tag based on the recommendation of @Berdir.
Comment #21
leolandotan commentedI have added the changes based on @Berdir's recommendations and tried to follow a deprecation pattern from other issues. I have also created a change record for your review.
Hope everything is in order.
Thanks!
Comment #22
yogeshmpawarComment #23
yogeshmpawarI have updated the deprecation message as per the format & Agree with @berdir suggestion over to remove "Apcu 4 was built.." part. Added an interdiff as well.
Comment #24
yogeshmpawarMissed one thing in the previous patch so added back with an interdiff.
Comment #26
yogeshmpawarAbove JS test fails are unrelated.
Comment #27
init90I've corrected some moments in deprecation message. Also, I decided use deprecation message format suggested by @berdir in comment #18, because it seems more relevant for our case.
Comment #28
init90I've updated CR.
Comment #29
init90I've changed deprecation format(one more time:), according to: Adopt consistent deprecation format for core and contrib deprecation messages
Comment #30
fconnolly commentedLooks good to me! :+1:
Comment #31
catchCommitted fa4c517 and pushed to 8.8.x. Thanks!
Comment #33
catch