Skip to content

Commit d6c05e1

Browse files
authored
Merge pull request #123 from froschdesign/hotfix/docs/10
Update caching documentation for laminas-cache
2 parents f09a48c + 94b57cc commit d6c05e1

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

docs/book/translator/caching.md

+10-4
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,15 @@ guarantees an optimized loading procedure.
1616
> ```bash
1717
> $ composer require laminas/laminas-cache-storage-deprecated-factory
1818
> ```
19+
>
20+
> laminas-cache is shipped without a specific cache adapter to allow free choice of storage backends and their dependencies.
21+
> So make sure that the required adapters are installed.
22+
>
23+
> The following example used the [memory adapter of laminas-cache](https://docs.laminas.dev/laminas-cache/storage/adapter/#memory-adapter):
24+
>
25+
> ```bash
26+
> $ composer require laminas/laminas-cache-storage-adapter-memory
27+
> ```
1928
2029
## Enable Caching
2130
@@ -26,10 +35,7 @@ method.
2635
$translator = new Laminas\I18n\Translator\Translator();
2736
$cache = Laminas\Cache\StorageFactory::factory([
2837
'adapter' => [
29-
'name' => Laminas\Cache\Storage\Adapter\Filesystem::class,
30-
'options' => [
31-
'cache_dir' => __DIR__ . '/cache',
32-
],
38+
'name' => Laminas\Cache\Storage\Adapter\Memory::class,
3339
],
3440
]);
3541
$translator->setCache($cache);

0 commit comments

Comments
 (0)