X-Git-Url: https://git.cweiske.de/phorkie.git/blobdiff_plain/046b6e8a7784e5a314ac71f20fbd9e8686d16d06..6bde4b82ec04ee5a1622220663bcacca2ec301d6:/src/phorkie/SetupCheck.php diff --git a/src/phorkie/SetupCheck.php b/src/phorkie/SetupCheck.php index 24f7009..b205b87 100644 --- a/src/phorkie/SetupCheck.php +++ b/src/phorkie/SetupCheck.php @@ -11,11 +11,10 @@ class SetupCheck 'pear.php.net/Pager' => 'Pager', 'pear.php.net/Services_Libravatar' => 'Services_Libravatar', 'zustellzentrum.cweiske.de/MIME_Type_PlainDetect' => 'MIME_Type_PlainDetect', - 'pear.michelf.ca/Markdown' => 'Markdown', ); protected $writableDirs; - + protected $elasticsearch; public function __construct() { @@ -24,6 +23,7 @@ class SetupCheck 'gitdir' => $cfg['gitdir'], 'workdir' => $cfg['workdir'], ); + $this->elasticsearch = $cfg['elasticsearch']; } public static function run() @@ -74,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(); }