Skip to content
This repository was archived by the owner on Apr 3, 2025. It is now read-only.

Commit 15efebc

Browse files
authored
Merge pull request #69 from roberto-butti/master
Update README.md
2 parents 7805963 + b16d394 commit 15efebc

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ In this README file you will find information for using the Storyblok PHP client
3636

3737
## Installing the Storyblok PHP client
3838
You can install the Storyblok PHP Client via composer.
39+
Storyblok's PHP client requires PHP version 7.3 to 8.2.
40+
The suggestion is to use an actively supported version of PHP (8.1 and 8.2).
3941

4042
If you want to install the _stable_ release of Storyblok PHP client you can launch:
4143
```bash
@@ -337,6 +339,17 @@ $result = $client->getStories();
337339
print_r($result);
338340
```
339341

342+
The caching mechanism uses under the hood the Symfony Cache package.
343+
So, you can use the Adapter supported the Symfony Cache.
344+
For example, for using a MySql database as cache storage, you can setup the connection via the PHP PDO class:
345+
```php
346+
$client = new \Storyblok\Client('your-storyblok-private-token');
347+
$pdo = new PDO('mysql:host=127.0.0.1;dbname=db_php-client;charset=utf8mb4;', "root");
348+
$client->setCache('mysql', ['pdo' => $pdo]);
349+
$result = $client->getStories();
350+
print_r($result);
351+
```
352+
340353
### Clearing the cache (Optionally if using setCache)
341354

342355
In order to flush the cache when the user clicks publish, you need to listen to the published event in javascript or define a webhook in the space settings that clears the cache on your server.

0 commit comments

Comments
 (0)