Any chance of building support for EntityCache? It might prove useful.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

fago’s picture

Category: feature » task

yep, I'd like to see that happen asap. Any tackers?

jamsilver’s picture

OK, here is a very rudimentary attempt to make 'entity cache' something pluggable and delegates calls to it in all the moments entitycache seems to need them at the moment.

Pretty sure this works at the moment if entitycache's EntityCacheControllerHelper is passed as the 'entity cache' value in hook_entity_info_alter() as long as EntityCacheControllerHelper's methods are changed from protected to public.

plach’s picture

fago’s picture

patch looks good to me. I guess we should add some usage instructions to the README?

quartsize’s picture

Is it support specifically for Entity cache that is desired, or persistent caching for EntityAPIController, with EntityCacheControllerHelper as a means to that end?

Fidelix’s picture

Definitely subscribing!
I'm coming from this issue: #1165930: Compatibility with Entity API

jamsilver’s picture

Status: Active » Needs review

@quartsize: the approach I took was the more general one. So this patch works persistent caching into EntityAPIController delegating everything to the class found in the 'entity cache' property of the entity info.

Which allows the persistent cache handler to be swapped out if necessary.

Having said that, I made it work with EntityCache in mind, I haven't thought about what other persistent caching mechanisms may exist and may require so any thoughts you have about making it sufficiently flexible are welcome =)

Note, the complimentary issue on entitycache module has been committed (#1165930: Compatibility with Entity API)

Status: Needs review » Needs work

The last submitted patch, entity-1111120-3-support-for-entitycache.no-prefix.patch, failed testing.

andypost’s picture

Status: Needs work » Needs review

So only README lines are should be done to make this happen. Seem this patch needs reroll but let's test it.

#2: entity-1111120-3-support-for-entitycache.patch queued for re-testing.

fago’s picture

Status: Needs review » Needs work

entity cache module defines the entity cache property as TRUE / FALSE - let's follow that and just use the class provided by the entity cache module.
Also I'm not keen on introducing a 'entity cache' property supporting arbitrary classes or without any interface or base class to extend. The latter could already be considered bad practice...

fago’s picture

Status: Needs work » Fixed
FileSize
3.53 KB

ok, I've implemented it that way and committed it. See attached patch.

amateescu’s picture

Status: Fixed » Reviewed & tested by the community

I can't see this in the repository.. maybe you forgot to push? :)

fago’s picture

Status: Reviewed & tested by the community » Fixed

exactly.. sry, pushed it now.

Status: Fixed » Closed (fixed)

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