From b3608bc1f2cf828426d5ee6e1393df3d5754e07a Mon Sep 17 00:00:00 2001 From: Seamus Lee <seamuslee001@gmail.com> Date: Tue, 16 Jul 2019 07:13:16 +1000 Subject: [PATCH] Include documentation on withArray parameter when creating Cache Service --- docs/framework/cache.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/framework/cache.md b/docs/framework/cache.md index cdd554d3..0bd59ac5 100644 --- a/docs/framework/cache.md +++ b/docs/framework/cache.md @@ -111,6 +111,7 @@ A few things to notice here: * The `name` will be passed down to the storage system -- ensuring that different caches are stored separately. * Ex: In `Memcached`/`Redis`, the `name` becomes part of the cache-key. * Ex: In `SqlGroup`, the `name` corresponds to the field `civicrm_cache.group_name`. +* There is an optional `withArray` parameter which if set to `fast` then the cache is wrapped in the `CRM_Utils_Cache_FastArrayDecorator` if type is memory and you have set to use memcache or redis. Once you have the `$cache` object, it supports all the methods of `CRM_Utils_Cache_Interface` and PSR-16. @@ -144,6 +145,7 @@ As before, notice that: * The `type` parameter is an array of preferred storage systems. It will choose the first valid driver. * The `name` will be passed down to the storage system. * The service is an instance of `CRM_Utils_Cache_Interface` (PSR-16). +* There is an optional `withArray` parameter which if set to `fast` then the cache is wrapped in the `CRM_Utils_Cache_FastArrayDecorator` if type is memory and you have set to use memcache or redis. Once the service is declared, we can get a reference to the cache in several ways: -- GitLab