git.cweiske.de
/
phorkie.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
776fadd
)
ADD: do a cursory validatation of the elasticsearch url
author
Justin J. Novack
<jnovack@gmail.com>
Tue, 25 Sep 2012 22:30:27 +0000
(18:30 -0400)
committer
Justin J. Novack
<jnovack@gmail.com>
Tue, 25 Sep 2012 22:40:23 +0000
(18:40 -0400)
src/phorkie/SetupCheck.php
patch
|
blob
|
history
diff --git
a/src/phorkie/SetupCheck.php
b/src/phorkie/SetupCheck.php
index b1107b51b15b66c26a6b982cc0146ac45024b400..f1fbc0f519e69d63d773e88db52b4713c8867a6d 100644
(file)
--- a/
src/phorkie/SetupCheck.php
+++ b/
src/phorkie/SetupCheck.php
@@
-14,7
+14,7
@@
class SetupCheck
);
protected $writableDirs;
);
protected $writableDirs;
-
+ protected $elasticsearch;
public function __construct()
{
public function __construct()
{
@@
-23,6
+23,7
@@
class SetupCheck
'gitdir' => $cfg['gitdir'],
'workdir' => $cfg['workdir'],
);
'gitdir' => $cfg['gitdir'],
'workdir' => $cfg['workdir'],
);
+ $this->elasticsearch = $cfg['elasticsearch'];
}
public static function run()
}
public static function run()
@@
-31,7
+32,9
@@
class SetupCheck
$sc->checkDeps();
$sc->checkDirs();
$sc->checkGit();
$sc->checkDeps();
$sc->checkDirs();
$sc->checkGit();
- $sc->checkDatabase();
+ if ($this->elasticsearch != '') {
+ $sc->checkDatabase();
+ }
}
public function checkDeps()
}
public function checkDeps()
@@
-73,6
+76,11
@@
class SetupCheck
public function checkDatabase()
{
public function checkDatabase()
{
+ $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();
}
$dbs = new Database();
$dbs->getSetup()->setup();
}