From ba593bfa39cebbc91aeae18ace5a86c0a8fda00c Mon Sep 17 00:00:00 2001 From: Miguel Dantas Date: Mon, 2 Sep 2019 16:42:10 +0100 Subject: [PATCH] [Memcached] Fix call to undefined method `close` Issue description as reported by aab: Memcached config in config.php: addPlugin('Memcached', [ 'servers' => ['127.0.0.1', 11211], 'defaultExpiry' => 86400 // 24h ]); Memcached and php-memchached installed. The error appears when executing startdaemons. Log: PHP Fatal error: Uncaught Error: Call to undefined method Memcached::close() in /var/www/html/plugins/Memcached/MemcachedPlugin.php:202 Stack trace: #0 /var/www/html/lib/event.php(89): MemcachedPlugin->onStartCacheReconnect(false) #1 /var/www/html/lib/cache.php(273): Event::handle('StartCacheRecon...', Array) #2 /var/www/html/lib/spawningdaemon.php(209): Cache->reconnect() #3 /var/www/html/lib/spawningdaemon.php(188): SpawningDaemon->resetDb() #4 /var/www/html/lib/spawningdaemon.php(118): SpawningDaemon->initAndRunChild(3) #5 /var/www/html/lib/daemon.php(168): SpawningDaemon->run() #6 /var/www/html/scripts/queuedaemon.php(186): Daemon->runOnce() #7 {main} thrown in /var/www/html/plugins/Memcached/MemcachedPlugin.php on line 202 --- plugins/Memcached/MemcachedPlugin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/Memcached/MemcachedPlugin.php b/plugins/Memcached/MemcachedPlugin.php index 2a5d719ef7..5466996542 100644 --- a/plugins/Memcached/MemcachedPlugin.php +++ b/plugins/Memcached/MemcachedPlugin.php @@ -199,7 +199,7 @@ class MemcachedPlugin extends Plugin $success = false; } else { common_log(LOG_INFO, "Closing memcached connection"); - $success = $this->_conn->close(); + $success = $this->_conn->quit(); $this->_conn = null; } return false;