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']); } }