From b16d394bf0e71e8018b7dabe72f59a5a29a1d333 Mon Sep 17 00:00:00 2001 From: Roberto Butti Date: Wed, 14 Dec 2022 22:03:39 +0100 Subject: [PATCH] Update README.md --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index 2357235..874598f 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,8 @@ In this README file you will find information for using the Storyblok PHP client ## Installing the Storyblok PHP client You can install the Storyblok PHP Client via composer. +Storyblok's PHP client requires PHP version 7.3 to 8.2. +The suggestion is to use an actively supported version of PHP (8.1 and 8.2). If you want to install the _stable_ release of Storyblok PHP client you can launch: ```bash @@ -337,6 +339,17 @@ $result = $client->getStories(); print_r($result); ``` +The caching mechanism uses under the hood the Symfony Cache package. +So, you can use the Adapter supported the Symfony Cache. +For example, for using a MySql database as cache storage, you can setup the connection via the PHP PDO class: +```php +$client = new \Storyblok\Client('your-storyblok-private-token'); +$pdo = new PDO('mysql:host=127.0.0.1;dbname=db_php-client;charset=utf8mb4;', "root"); +$client->setCache('mysql', ['pdo' => $pdo]); +$result = $client->getStories(); +print_r($result); +``` + ### Clearing the cache (Optionally if using setCache) 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.