Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
WP Plugins
Redis Page Cache
Commits
f914fcb9
Commit
f914fcb9
authored
Nov 22, 2013
by
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
Changes
2
Hide whitespace changes
Inline
Side-by-side
index-wp-redis.php
View file @
f914fcb9
...
...
@@ -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
();
}
...
...
wp-redis-cache/cache.php
View file @
f914fcb9
...
...
@@ -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
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment