X-Git-Url: https://git.cweiske.de/phorkie.git/blobdiff_plain/776fadd33815e9e1b342b1cb30a6ca5debb760f2..6bde4b82ec04ee5a1622220663bcacca2ec301d6:/src/phorkie/SetupCheck.php diff --git a/src/phorkie/SetupCheck.php b/src/phorkie/SetupCheck.php index b1107b5..b205b87 100644 --- a/src/phorkie/SetupCheck.php +++ b/src/phorkie/SetupCheck.php @@ -14,7 +14,7 @@ class SetupCheck ); protected $writableDirs; - + protected $elasticsearch; public function __construct() { @@ -23,6 +23,7 @@ class SetupCheck 'gitdir' => $cfg['gitdir'], 'workdir' => $cfg['workdir'], ); + $this->elasticsearch = $cfg['elasticsearch']; } public static function run() @@ -73,6 +74,18 @@ class SetupCheck public function checkDatabase() { + if ($this->elasticsearch == '') { + return; + } + + $es = parse_url($this->elasticsearch); + if (!preg_match("#/.+/#", $es['path'], $matches)) { + $this->fail( + 'Improper elasticsearch url. Elasticsearch requires a' + . ' search domain to store your data.' + . ' (e.g. http://localhost:9200/phorkie/)' + ); + } $dbs = new Database(); $dbs->getSetup()->setup(); }