Commit f914fcb9 authored by Benjamin Adams's avatar Benjamin Adams
Browse files

Merge pull request #8 from aaronstpierre/master

Added include_once to fix PHP Fatal Error on Predisexeption class redecl...
parents 3e93e42b 0fa46a83
...@@ -38,7 +38,7 @@ try { ...@@ -38,7 +38,7 @@ try {
} else // Fallback to predis5.2.php } 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(); $redis = new Predis_Client();
} }
......
...@@ -10,7 +10,8 @@ if($new == "publish") ...@@ -10,7 +10,8 @@ if($new == "publish")
{ {
$permalink = get_permalink( $post->ID ); $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 = new Predis_Client();
$redis_key = md5($permalink); $redis_key = md5($permalink);
...@@ -21,4 +22,4 @@ $frontPage = get_home_url() . "/"; ...@@ -21,4 +22,4 @@ $frontPage = get_home_url() . "/";
$redis_key = md5($frontPage); $redis_key = md5($frontPage);
$redis->del($redis_key); $redis->del($redis_key);
} }
} }
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment