10, //'retry_interval' => 2, /* 'persistent' => 1, 'persistent_id' => null, 'timeout' => 10, 'tcp_keepalive' => 0, 'lazy' => null, 'redis_cluster' => false, 'redis_sentinel' => null,*/ ] ); //var_dump($redisConnection->isConnected()); }catch (\Exception $exception) { //echo $exception->getMessage(); $redisConnection = false; } if(!$redisConnection) { static::$redisCache = false; return false; } static::$redisCache = new RedisAdapter( // the object that stores a valid connection to your Redis system $redisConnection, // the string prefixed to the keys of the items stored in this cache $namespace = '', // the default lifetime (in seconds) for cache items that do not define their // own lifetime, with a value 0 causing items to be stored indefinitely (i.e. // until RedisAdapter::clear() is invoked or the server(s) are purged) $defaultLifetime = 10 ); return static::$redisCache; } }