@@ -22,9 +22,11 @@ composer require asanikovich/laravel-roadrunner-cache
2222
2323### Configuration
2424
25- Make sure you have in your RoadRunner config file (.rr.yaml) next sections:
26- - RPC section
27- - KV section
25+ #### Configuration RoadRunner
26+
27+ Make sure you have in your RoadRunner config file (` .rr.yaml ` ) next sections:
28+ - ` RPC ` section
29+ - ` KV ` section
2830
2931Full example of RoadRunner configuration file:
3032``` yaml
4850 interval : 1
4951` ` `
5052
53+ #### Publish config
5154Publish the config file and setup RPC connection:
5255
5356` ` ` bash
5457php artisan vendor:publish --tag="laravel-roadrunner-cache-config"
5558```
5659
57- Add to cache configuration file (/config/cache.php) new store with driver 'roadrunner':
60+ #### Serializers
61+
62+ Package supports next serializers (should be configured in ` store ` config):
63+ - ` null ` - default php ` serializer `
64+ - ` igbinary ` - igbinary serializer, ` ext-igbinary ` is required to be installed
65+
66+ #### Encryption
67+
68+ Package supports encryption with ` sodium ` , requirements:
69+ - ` ext-sodium ` required to be installed
70+ - ` encryption_key ` filled in ` store ` config (generated by ` sodium_crypto_box_keypair() ` )
71+
72+ #### Setup cache config file
73+
74+ Add to cache configuration file (` /config/cache.php ` ) new store with driver ` roadrunner ` :
75+
76+ #### Config file example
5877``` php
5978<?php
79+ return [
6080 'default' => 'rr-memory', // Default store (optional)
6181
6282 'stores' => [
63- 'rr-memory' => [ // Your custom store name
83+ 'rr-memory' => [ // Custom store name with "memory" connection
6484 'driver' => 'roadrunner',
65- // section name from KV plugin settings in RoadRunner config file (.rr.yaml)
66- 'connection' => 'memory',
85+ 'connection' => 'memory', // section name from KV plugin settings in RoadRunner config file (.rr.yaml)
86+ 'serializer' => null, // Available options: null|igbinary
87+ 'encryption_key' => null, // Available options: null|string
6788 ],
68- 'rr-boltdb' => [ // Your custom store name (another store is optional)
89+ 'rr-boltdb' => [ // Custom store name with "boltdb" connection (another store is optional)
6990 'driver' => 'roadrunner',
70- // section name from KV plugin settings in RoadRunner config file (.rr.yaml)
71- 'connection' => 'boltdb',
91+ 'connection' => 'boltdb', // section name from KV plugin settings in RoadRunner config file (.rr.yaml)
92+ 'serializer' => null, // Available options: null|igbinary
93+ 'encryption_key' => null, // Available options: null|string
94+ 'prefix' => 'custom', // Custom prefix - non-empty-string
95+ ],
96+ 'rr-memory-igbinary' => [ // Custom store name with "memory" connection and "igbinary" serializer
97+ 'driver' => 'roadrunner',
98+ 'connection' => 'memory', // section name from KV plugin settings in RoadRunner config file (.rr.yaml)
99+ 'serializer' => 'igbinary', // Available options: null|igbinary
100+ 'encryption_key' => null, // Available options: null|string
101+ ],
102+ 'rr-memory-igbinary-encrypted' => [ // Custom store name with "memory" connection and encrypted "igbinary" serializer
103+ 'driver' => 'roadrunner',
104+ 'connection' => 'memory', // section name from KV plugin settings in RoadRunner config file (.rr.yaml)
105+ 'serializer' => 'igbinary', // Available options: null|igbinary
106+ 'encryption_key' => 'key1', // Available options: null|string
107+ ],
108+ 'rr-memory-encrypted' => [ // Custom store name with "memory" connection and encrypted serializer
109+ 'driver' => 'roadrunner',
110+ 'connection' => 'memory', // section name from KV plugin settings in RoadRunner config file (.rr.yaml)
111+ 'serializer' => null, // Available options: null|igbinary
112+ 'encryption_key' => 'key2', // Available options: null|string
72113 ],
73114 ],
115+ ]
74116```
75117
118+ ### Usage
119+
76120To use in your code:
77121``` php
78122<?php
0 commit comments