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 (parent:
d9245ba
)
check git version in setupcheck
author
Christian Weiske
<cweiske@cweiske.de>
Thu, 26 Apr 2012 04:43:38 +0000
(06:43 +0200)
committer
Christian Weiske
<cweiske@cweiske.de>
Thu, 26 Apr 2012 04:43:38 +0000
(06:43 +0200)
src/phorkie/SetupCheck.php
patch
|
blob
|
history
diff --git
a/src/phorkie/SetupCheck.php
b/src/phorkie/SetupCheck.php
index
959ff42
..
2c0dd80
100644
(file)
--- a/
src/phorkie/SetupCheck.php
+++ b/
src/phorkie/SetupCheck.php
@@
-26,6
+26,7
@@
class SetupCheck
$sc = new self();
$sc->checkDeps();
$sc->checkDirs();
$sc = new self();
$sc->checkDeps();
$sc->checkDirs();
+ $sc->checkGit();
}
public function checkDeps()
}
public function checkDeps()
@@
-49,6
+50,22
@@
class SetupCheck
}
}
}
}
+ public function checkGit()
+ {
+ $line = exec('git --version', $lines, $retval);
+ if ($retval !== 0) {
+ $this->fail('Running git executable failed.');
+ }
+ if (!preg_match('#^git version ([0-9.]+)$#', $line, $matches)) {
+ $this->fail('git version output format unexpected: ' . $line);
+ }
+ if (version_compare($matches[1], '1.7.5') < 0) {
+ $this->fail(
+ 'git version needs to be at least 1.7.5, got: ' . $matches[1]
+ );
+ }
+ }
+
public function fail($msg)
{
throw new Exception($msg);
public function fail($msg)
{
throw new Exception($msg);