From 5338f75cae1cf9be97c5279b1d73fda2f405a3d8 Mon Sep 17 00:00:00 2001 From: Steve Hitchman Date: Mon, 16 Nov 2020 09:28:43 +0000 Subject: [PATCH] Remove Elasticsearch installer requirement --- src/Console/Commands/InstallGetCandyCommand.php | 15 --------------- src/Installer/Runners/PreflightRunner.php | 16 ---------------- 2 files changed, 31 deletions(-) diff --git a/src/Console/Commands/InstallGetCandyCommand.php b/src/Console/Commands/InstallGetCandyCommand.php index 9bd129ace..92a8dedac 100644 --- a/src/Console/Commands/InstallGetCandyCommand.php +++ b/src/Console/Commands/InstallGetCandyCommand.php @@ -49,21 +49,6 @@ public function handle(Dispatcher $events, GetCandyInstaller $installer) exit(1); } - - $elasticsearch = $event->response['elasticsearch']; - - if (! $elasticsearch['connected']) { - $this->error('Unable to connect to elasticsearh'); - $this->warn('Did you remember to configure the connection in config/getcandy.php?'); - - exit(1); - } - - if (! $elasticsearch['success']) { - $this->error("GetCandy requires Elasticsearch version 6.8(.x). You're running version {$elasticsearch['version']}"); - - exit(1); - } }); // Run the installer... diff --git a/src/Installer/Runners/PreflightRunner.php b/src/Installer/Runners/PreflightRunner.php index f19ef2a60..e3b9a8858 100644 --- a/src/Installer/Runners/PreflightRunner.php +++ b/src/Installer/Runners/PreflightRunner.php @@ -26,14 +26,6 @@ public function run() $dbVersion = null; } - try { - $elastica = new Client(config('getcandy.search.client_config.elastic')); - $result = $elastica->request('/'); - $esVersion = $result->getData()['version']['number']; - } catch (HttpException $e) { - $esVersion = null; - } - event(new PreflightCompletedEvent([ 'api' => [ 'version' => $apiVersion, @@ -44,14 +36,6 @@ public function run() 'connected' => $dbVersion ?? false, 'success' => (bool) $dbVersion, ], - 'elasticsearch' => [ - 'version' => $esVersion, - 'connected' => $esVersion ?? false, - 'success' => $esVersion !== null - && version_compare($esVersion, '6.9', '<') - && version_compare($esVersion, '6.8', '>='), - - ], ])); return $this;