From a5ca94c84f28695f3abdd43d3fded8a9ee33beb1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jaime=20Pe=CC=81rez=20Crespo?= <jaime.perez@uninett.no>
Date: Thu, 30 Mar 2017 10:23:56 +0200
Subject: [PATCH] Add a check to the constructor of the new redis store to
 check if predis/predis is available, and throw a critical configuration error
 if not.

---
 lib/SimpleSAML/Store/Redis.php | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/SimpleSAML/Store/Redis.php b/lib/SimpleSAML/Store/Redis.php
index af1b94c8b..f7fc0fa84 100644
--- a/lib/SimpleSAML/Store/Redis.php
+++ b/lib/SimpleSAML/Store/Redis.php
@@ -19,6 +19,10 @@ class Redis extends Store
     {
         assert('is_null($redis) || is_subclass_of($redis, "Predis\\Client")');
 
+        if (!class_exists('\Predis\Client')) {
+            throw new \SimpleSAML\Error\CriticalConfigurationError('predis/predis is not available.');
+        }
+
         if (is_null($redis)) {
             $config = Configuration::getInstance();
 
-- 
GitLab