do not try to delete if file does not exist
[phorkie.git] / src / phorkie / SetupCheck.php
index f1fbc0f519e69d63d773e88db52b4713c8867a6d..b205b87baa60a43631e0bd5281d85ccd873245fe 100644 (file)
@@ -32,9 +32,7 @@ class SetupCheck
         $sc->checkDeps();
         $sc->checkDirs();
         $sc->checkGit();
-        if ($this->elasticsearch != '') {
-            $sc->checkDatabase();
-        }
+        $sc->checkDatabase();
     }
 
     public function checkDeps()
@@ -76,10 +74,17 @@ 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/)');
+            $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();