The installer contains a smart hack to temporarily override $settings to use the KeyValueMemoryFactory instead of the default database factory implementation.

This override and temporary adjustment (and rollback) of $settings can be avoided by registering the KeyValueMemoryFactory directly in the service container.

Doing so reveals that the KeyValueFactory service is swappable, but some other services are using type-hints that explicitly ask for the default implementation. Hence, we need to add an interface for the factory service.

CommentFileSizeAuthor
drupal8.keyvaluefactoryinterface.0.patch11.56 KBsun

Comments

jibran’s picture

Status: Needs review » Reviewed & tested by the community

Seems simple enough so RTBC.

andypost’s picture

+1 rtbc here

sun’s picture

Priority: Normal » Major
dries’s picture

Status: Reviewed & tested by the community » Fixed

Nice clean-up. Committed to 8.x.

berdir’s picture

This uses the same interface for the expirable key value store, that returns a different interface. See #2160495: Add a KeyValueExpirableFactoryInterface.

Status: Fixed » Closed (fixed)

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