@@ -33,8 +33,9 @@ For simple cases where Redis is running on the same server, this usually works:
3333 $redis = new \Redis();
3434 $redis->connect('127.0.0.1', 6379);
3535
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 `
3839class.
3940
4041The 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
338339when it is not specified in the ` set() ` or ` setMultiple() ` methods.
339340
340341By 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.
343343
344344Personally I think that rarely is a good idea. Web applications _ SHOULD_
345345either delete the cached entry or update the cached entry when the data is
@@ -376,11 +376,13 @@ It is needed for unit testing.
376376Exceptions
377377----------
378378
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:
381381
3823821 . The data type used in a parameter is incorrect
3833832 . 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.
384386
385387### Data Type Exceptions
386388
@@ -424,7 +426,27 @@ In those circumstances, this class will throw a:
424426
425427Exception.
426428
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.
428450
429451
430452### About Catching Exceptions
0 commit comments