From 94b57cc74b86e96bf2d4799f6cc8fc89c694878a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Br=C3=BCckner?= Date: Sat, 18 May 2024 23:05:58 +0200 Subject: [PATCH] Update caching documentation for laminas-cache MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #10 Signed-off-by: Frank Brückner --- docs/book/translator/caching.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/docs/book/translator/caching.md b/docs/book/translator/caching.md index fdea25ce..6ff61dae 100755 --- a/docs/book/translator/caching.md +++ b/docs/book/translator/caching.md @@ -16,6 +16,15 @@ guarantees an optimized loading procedure. > ```bash > $ composer require laminas/laminas-cache-storage-deprecated-factory > ``` +> +> laminas-cache is shipped without a specific cache adapter to allow free choice of storage backends and their dependencies. +> So make sure that the required adapters are installed. +> +> The following example used the [memory adapter of laminas-cache](https://docs.laminas.dev/laminas-cache/storage/adapter/#memory-adapter): +> +> ```bash +> $ composer require laminas/laminas-cache-storage-adapter-memory +> ``` ## Enable Caching @@ -26,10 +35,7 @@ method. $translator = new Laminas\I18n\Translator\Translator(); $cache = Laminas\Cache\StorageFactory::factory([ 'adapter' => [ - 'name' => Laminas\Cache\Storage\Adapter\Filesystem::class, - 'options' => [ - 'cache_dir' => __DIR__ . '/cache', - ], + 'name' => Laminas\Cache\Storage\Adapter\Memory::class, ], ]); $translator->setCache($cache);