X-Git-Url: https://git.cweiske.de/phorkie.git/blobdiff_plain/ef6622826a0c0a1132537492698768a250cb1e04..d63a7b14a6e1140fe5aa0610b1490f69b3494623:/src/phorkie/SetupCheck.php diff --git a/src/phorkie/SetupCheck.php b/src/phorkie/SetupCheck.php index 8ead33f..0affe05 100644 --- a/src/phorkie/SetupCheck.php +++ b/src/phorkie/SetupCheck.php @@ -8,12 +8,14 @@ class SetupCheck 'pear.twig-project.org/Twig' => 'Twig_Autoloader', 'pear.php.net/Date_HumanDiff' => 'Date_HumanDiff', 'pear.php.net/HTTP_Request2' => 'HTTP_Request2', + 'pear.php.net/OpenID' => 'OpenID', 'pear.php.net/Pager' => 'Pager', 'pear.php.net/Services_Libravatar' => 'Services_Libravatar', + 'zustellzentrum.cweiske.de/MIME_Type_PlainDetect' => 'MIME_Type_PlainDetect', ); protected $writableDirs; - + protected $elasticsearch; public function __construct() { @@ -22,6 +24,7 @@ class SetupCheck 'gitdir' => $cfg['gitdir'], 'workdir' => $cfg['workdir'], ); + $this->elasticsearch = $cfg['elasticsearch']; } public static function run() @@ -40,6 +43,18 @@ class SetupCheck $this->fail('PEAR package not installed: ' . $package); } } + + $geshi = stream_resolve_include_path( + $GLOBALS['phorkie']['cfg']['geshi'] + ); + if ($geshi === false) { + $this->fail('GeSHi not available'); + } + + $markdown = stream_resolve_include_path('markdown.php'); + if ($markdown === false) { + $this->fail('Markdown renderer not available'); + } } public function checkDirs() @@ -72,6 +87,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(); }