@@ -33,8 +33,9 @@ For simple cases where Redis is running on the same server, this usually works:
33
33
$redis = new \Redis();
34
34
$redis->connect('127.0.0.1', 6379);
35
35
36
- If you need more complexity than that, see the PECL class documentation. Once
37
- you have that object, you can create an instance of the ` SimpleCacheRedis `
36
+ If you need more complexity than that, see the
37
+ [ PECL Connection documentation] ( https://github.com/phpredis/phpredis/#connection ) .
38
+ Once you have that object, you can create an instance of the ` SimpleCacheRedis `
38
39
class.
39
40
40
41
The easiest way to create an object of the ` SimpleCacheRedis ` class:
@@ -338,8 +339,7 @@ This allows you to specify the default number of seconds to use for the TTL
338
339
when it is not specified in the ` set() ` or ` setMultiple() ` methods.
339
340
340
341
By default, the value is ` 0 ` which tells Redis to keep the ` key => value `
341
- pair in cache until the server daemon is restarted or until the memory is
342
- needed for something else.
342
+ pair in cache until you specifically replace it or specifically delete it.
343
343
344
344
Personally I think that rarely is a good idea. Web applications _ SHOULD_
345
345
either delete the cached entry or update the cached entry when the data is
@@ -376,11 +376,13 @@ It is needed for unit testing.
376
376
Exceptions
377
377
----------
378
378
379
- There are two conditions that can cause SimpleCacheRedis to intentionally throw
380
- an exception:
379
+ There are three conditions that can cause SimpleCacheRedis to intentionally
380
+ throw an exception:
381
381
382
382
1 . The data type used in a parameter is incorrect
383
383
2 . The data used in a parameter is not valid for use
384
+ 3 . There is an issue connecting with the Redis server or if you are using the
385
+ Sodium variant, there is an issue that will prevent encryption from working.
384
386
385
387
### Data Type Exceptions
386
388
@@ -424,7 +426,27 @@ In those circumstances, this class will throw a:
424
426
425
427
Exception.
426
428
427
- You can catch these based on ` InvalidArgumentException ` or the PSR implementation.
429
+ You can catch these based on ` \InvalidArgumentException ` or the PSR
430
+ implementation.
431
+
432
+
433
+ ### Setup Exceptions
434
+
435
+ Exceptions of this type only happen when either the class is not able to
436
+ connect to the Redis server, you are using the Sodium variant and do not have
437
+ the libsodium functions available, you specified a JSON configuration file that
438
+ does not exist or is invalid, your encryption key is not valid, or something is
439
+ broken resulting in the encryption nonce not being properly incremented.
440
+
441
+ In those circumstances, this class will throw a:
442
+
443
+ \AWonderPHP\SimpleCache\InvalidSetupException
444
+ extends \ErrorException
445
+ implements \Psr\SimpleCache\CacheException
446
+
447
+ Exception.
448
+
449
+ You can catch these based on ` \ErrorException ` or the PSR implementation.
428
450
429
451
430
452
### About Catching Exceptions
0 commit comments