From 5bfd285b6fa3cf0aa7d1d34f70ffaea057ff9de7 Mon Sep 17 00:00:00 2001 From: DariusIII Date: Mon, 12 Feb 2018 23:11:23 +0100 Subject: [PATCH] Create local variable for Helper class in SphinxSearch --- Changelog | 1 + nntmux/SphinxSearch.php | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Changelog b/Changelog index aa39bc982..233b87f99 100755 --- a/Changelog +++ b/Changelog @@ -1,4 +1,5 @@ 2018-02-12 DariusIII + * Chg: Create local variable for Helper class in SphinxSearch * Fix: Fix wrong categories used in searchByImdbId function * Chg: Update exeu/apai-io to version 2.2.0 * Chg: Update composer.json, remove ext-yenc suggestion and add ext-bcmath as required diff --git a/nntmux/SphinxSearch.php b/nntmux/SphinxSearch.php index a58aabce7..6143bc7cc 100755 --- a/nntmux/SphinxSearch.php +++ b/nntmux/SphinxSearch.php @@ -24,6 +24,11 @@ class SphinxSearch */ protected $config; + /** + * @var \Foolz\SphinxQL\Helper + */ + protected $helper; + /** * Establish connection to SphinxQL. * @@ -35,6 +40,7 @@ class SphinxSearch $this->config = config('sphinxsearch'); $this->connection->setParams(['host' => $this->config['host'], 'port' => $this->config['port']]); $this->sphinxQL = SphinxQL::create($this->connection); + $this->helper = Helper::create($this->connection); } /** @@ -110,7 +116,7 @@ class SphinxSearch */ public function truncateRTIndex(): void { - Helper::create($this->connection)->truncateRtIndex($this->config['index']); + $this->helper->truncateRtIndex($this->config['index']); } /** @@ -118,7 +124,7 @@ class SphinxSearch */ public function optimizeRTIndex(): void { - Helper::create($this->connection)->flushRtIndex($this->config['index']); - Helper::create($this->connection)->optimizeIndex($this->config['index']); + $this->helper->flushRtIndex($this->config['index']); + $this->helper->optimizeIndex($this->config['index']); } }