From 0fa46a83e9db3df40a28555b13c1930557ff5f81 Mon Sep 17 00:00:00 2001
From: "Aaron J. St. Piere" <asp@p0v.net>
Date: Fri, 22 Nov 2013 15:38:54 +0000
Subject: [PATCH] Added include_once to fix PHP Fatal Error on Predisexeption
 class redeclaration

---
 index-wp-redis.php       | 2 +-
 wp-redis-cache/cache.php | 5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/index-wp-redis.php b/index-wp-redis.php
index d59c3c6..55899d2 100644
--- a/index-wp-redis.php
+++ b/index-wp-redis.php
@@ -38,7 +38,7 @@ try {
         
     } else // Fallback to predis5.2.php
     {
-        include("wp-content/plugins/wp-redis-cache/predis5.2.php"); //we need this to use Redis inside of PHP
+        include_once("wp-content/plugins/wp-redis-cache/predis5.2.php"); //we need this to use Redis inside of PHP
         $redis = new Predis_Client();
     }
     
diff --git a/wp-redis-cache/cache.php b/wp-redis-cache/cache.php
index 9f8587d..e4dd76e 100644
--- a/wp-redis-cache/cache.php
+++ b/wp-redis-cache/cache.php
@@ -10,7 +10,8 @@ if($new == "publish")
 {
 $permalink = get_permalink( $post->ID );
 
-include("predis5.2.php");  //we need this to use Redis inside of PHP
+// aaronstpierre: this needs to be include_once so as not to cauase a redeclaration error
+include_once("predis5.2.php");  //we need this to use Redis inside of PHP
 $redis = new Predis_Client();
 
 $redis_key = md5($permalink);
@@ -21,4 +22,4 @@ $frontPage = get_home_url() . "/";
 $redis_key = md5($frontPage);
 $redis->del($redis_key);
 }
-}
\ No newline at end of file
+}
-- 
GitLab