Skip to content

Commit 3bb5b82

Browse files
committed
Added example for Symfony 4/Flex file structure
1 parent fe93fc4 commit 3bb5b82

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ $ composer require toflar/psr6-symfony-http-cache-store
3535

3636
## Configuration
3737

38-
Use the `Psr6Store` by enabling it in your `AppCache` as follows:
38+
For the Symfony 3 standard edition file structure, use the `Psr6Store` by
39+
enabling it in your `AppCache` as follows:
3940

4041
```php
4142
<?php
@@ -57,6 +58,16 @@ Use the `Psr6Store` by enabling it in your `AppCache` as follows:
5758

5859
```
5960

61+
For the Symfony 4/Flex structure, you need to adjust your `index.php` like this:
62+
63+
```php
64+
<?php
65+
66+
// public/index.php
67+
$kernel = new Kernel($env, $debug);
68+
$kernel = new HttpCache($kernel, new Psr6Store(['cache_directory' => $kernel->getCacheDir()]));
69+
```
70+
6071
That's it, that's all there is to do. The `Psr6Store` will automatically
6172
create the best caching and locking adapters available for your local filesystem.
6273

0 commit comments

Comments
 (0)