From 55c63949c43597beca2d2ff92b43e518bf765a2d Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sat, 3 Feb 2018 00:43:57 -0500 Subject: [PATCH] Clean up Core\Cache file - Remove unused use statement - Use explicit types for Memcache object --- src/Core/Cache.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Core/Cache.php b/src/Core/Cache.php index 05ccdd4fe..1f3c9e82f 100644 --- a/src/Core/Cache.php +++ b/src/Core/Cache.php @@ -5,7 +5,6 @@ namespace Friendica\Core; use Friendica\Core\Config; -use Friendica\Core\PConfig; use Friendica\Database\DBM; use dba; @@ -17,13 +16,13 @@ require_once 'include/dba.php'; class Cache { /** - * @brief Check for memcache and open a connection if configured + * @brief Check for Memcache and open a connection if configured * - * @return object|boolean The memcache object - or "false" if not successful + * @return Memcache|boolean The Memcache object - or "false" if not successful */ public static function memcache() { - if (!function_exists('memcache_connect')) { + if (!class_exists('\Memcache', false)) { return false; } @@ -34,7 +33,7 @@ class Cache $memcache_host = Config::get('system', 'memcache_host', '127.0.0.1'); $memcache_port = Config::get('system', 'memcache_port', 11211); - $memcache = new \Memcache; + $memcache = new \Memcache(); if (!$memcache->connect($memcache_host, $memcache_port)) { return false;