Skip to content

Commit

Permalink
Update caching documentation for laminas-cache
Browse files Browse the repository at this point in the history
Fixes #10

Signed-off-by: Frank Brückner <dev@froschdesignstudio.de>
  • Loading branch information
froschdesign committed May 18, 2024
1 parent b3259ac commit 9fe9af5
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions docs/book/translator/caching.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ guarantees an optimized loading procedure.
> ```bash
> $ composer require laminas/laminas-cache-storage-deprecated-factory
> ```

Check failure on line 18 in docs/book/translator/caching.md

View workflow job for this annotation

GitHub Actions / ci / QA Checks (Documentation Linting [8.1, locked], ubuntu-latest, laminas/laminas-continuous-integra...

Fenced code blocks should be surrounded by blank lines [Context: "> ```"]
> 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
Expand All @@ -26,10 +34,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);
Expand Down

0 comments on commit 9fe9af5

Please sign in to comment.