From 7d1506ccbec8bf43280cc6af5dec7b81c1134921 Mon Sep 17 00:00:00 2001 From: Luke Woodward <luke.woodward@10up.com> Date: Fri, 16 May 2014 16:52:57 -0700 Subject: [PATCH] Use the redis PHP serializer by default --- object-cache.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/object-cache.php b/object-cache.php index de34043..0e19283 100644 --- a/object-cache.php +++ b/object-cache.php @@ -326,11 +326,17 @@ class WP_Object_Cache { if ( defined( 'WP_REDIS_BACKEND_DB' ) && WP_REDIS_BACKEND_DB ) { $redis['database'] = WP_REDIS_BACKEND_DB; } + if ( ( defined( 'WP_REDIS_SERIALIZER' ) ) ) { + $redis['serializer'] = WP_REDIS_SERIALIZER; + } else { + $redis['serializer'] = Redis::SERIALIZER_PHP; + } // Use Redis PECL library. try { $this->redis = new Redis(); $this->redis->connect( $redis['host'], $redis['port'] ); + $this->redis->setOption( Redis::OPT_SERIALIZER, $redis['serializer'] ); if ( isset( $redis['auth'] ) ) { $this->redis->auth( $redis['auth'] ); -- GitLab