Problem/Motivation

The memory backend itself doesn't need bin as a constructor, separation of caches is handled by the factory.

Proposed resolution

Remove the constructor and the code supporting it.

Remaining tasks

User interface changes

API changes

Data model changes

Comments

catch created an issue. See original summary.

catch’s picture

Status: Active » Needs review
StatusFileSize
new1.56 KB
catch’s picture

StatusFileSize
new1.17 KB
dawehner’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Quickfix

Sure, why not!

catch’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new9.48 KB

Found some extra.

Status: Needs review » Needs work

The last submitted patch, 5: 2780905.patch, failed testing.

catch’s picture

Status: Needs work » Needs review
StatusFileSize
new8.42 KB

Try that again, looks like 8.2.x and 8.3.x divergence.

catch’s picture

StatusFileSize
new9.66 KB

The last submitted patch, 7: 2780905.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 8: 2780905.patch, failed testing.

catch’s picture

Status: Needs work » Needs review
StatusFileSize
new9.06 KB

Some memory backends are not like the others.

joelpittet’s picture

Status: Needs review » Reviewed & tested by the community

nice cleanup

The last submitted patch, 2: 2780905.patch, failed testing.

alexpott’s picture

The interdiff of #8 and #11 is:

reverted:
--- b/core/modules/system/src/Tests/System/FloodTest.php
+++ a/core/modules/system/src/Tests/System/FloodTest.php
@@ -61,7 +61,7 @@
     $name = 'flood_test_cleanup';

     $request_stack = \Drupal::service('request_stack');
+    $flood = new MemoryBackend($request_stack);
-    $flood = new MemoryBackend();
     // Register expired event.
     $flood->register($name, $window_expired);
     // Verify event is not allowed.
joelpittet’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new12.16 KB
new3.1 KB

Actually I spotted a couple more, @catch maybe you missed these or you had a reason to exclude them? I remove the Drupal::service() call too (see interdiff) because it was unused.

joelpittet’s picture

StatusFileSize
new11.54 KB

Whoops reverted #14 too(same interdiff as #14), should have read #11 closer.

The last submitted patch, 15: 2780905-15.patch, failed testing.

dawehner’s picture

Title: MemoryBackend has a pointless constructor » cache MemoryBackend has a pointless constructor
Status: Needs review » Reviewed & tested by the community

Right, this is just about cache backends, let's be clear about it.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs change record

We've also got to fix

    $memoryCounterBackend = new MemoryCounterBackend('default');

Since that backend extends MemoryBackend.

Also I think we need a change records for this.

joelpittet’s picture

Status: Needs work » Needs review
StatusFileSize
new12.21 KB
new680 bytes

Sorry missed that thanks @alexpott. Checked for other extends and I think we got them all now.

joelpittet’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs change record

Added a change record. Feel free to modify it.
https://www.drupal.org/node/2783813

Checked for more cases and quite sure this is back to RTBC, please let me know if my self-RTBC has gotten out of control and I've went too far!

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 20: cache_memorybackend_has-2780905-20.patch, failed testing.

joelpittet’s picture

Status: Needs work » Reviewed & tested by the community
catch’s picture

#20 looks good, sorry I missed that one.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed af1abd8 and pushed to 8.3.x. Thanks!

  • alexpott committed af1abd8 on 8.3.x
    Issue #2780905 by catch, joelpittet: cache MemoryBackend has a pointless...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.