git.cweiske.de
/
phorkie.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
update 0.5.0 changelog
[phorkie.git]
/
src
/
phorkie
/
SetupCheck.php
diff --git
a/src/phorkie/SetupCheck.php
b/src/phorkie/SetupCheck.php
index 69cffd8f073e7b200dfb861eeb1a92183f2858ce..32fb79e2d2ef94aba344d2a53d04b80ccb9c23b7 100644
(file)
--- a/
src/phorkie/SetupCheck.php
+++ b/
src/phorkie/SetupCheck.php
@@
-24,8
+24,8
@@
class SetupCheck
{
$cfg = $GLOBALS['phorkie']['cfg'];
$this->writableDirs = array(
{
$cfg = $GLOBALS['phorkie']['cfg'];
$this->writableDirs = array(
- 'gitdir'
=> $cfg['gitdir']
,
- 'workdir' =>
$cfg['workdir']
,
+ 'gitdir'
=> Tools::foldPath($cfg['gitdir'])
,
+ 'workdir' =>
Tools::foldPath($cfg['workdir'])
,
);
$this->elasticsearch = $cfg['elasticsearch'];
}
);
$this->elasticsearch = $cfg['elasticsearch'];
}
@@
-46,11
+46,21
@@
class SetupCheck
public function checkConfigFiles()
{
public function checkConfigFiles()
{
+ if (!isset($GLOBALS['phorkie']['cfgfiles'])
+ || count($GLOBALS['phorkie']['cfgfiles']) == 0
+ ) {
+ $this->info('No config files registered');
+ return;
+ }
+
foreach ($GLOBALS['phorkie']['cfgfiles'] as $file => $loaded) {
if ($loaded) {
foreach ($GLOBALS['phorkie']['cfgfiles'] as $file => $loaded) {
if ($loaded) {
- $this->ok('Loaded config file: ' .
$file
);
+ $this->ok('Loaded config file: ' .
Tools::foldPath($file)
);
} else {
} else {
- $this->info('Possible config file: ' . $file . ' (not loaded)');
+ $this->info(
+ 'Possible config file: ' . Tools::foldPath($file)
+ . ' (not loaded)'
+ );
}
}
}
}
}
}
@@
-98,8
+108,9
@@
class SetupCheck
if ($retval !== 0) {
$this->fail('Running git executable failed.');
}
if ($retval !== 0) {
$this->fail('Running git executable failed.');
}
- if (!preg_match('#^git version ([0-9.]+(rc[0-9]+)?)$#', $line, $matches)) {
+ if (!preg_match('#^git version ([0-9.]+(rc[0-9]+)?)
(?: \(Apple Git-\d+\))?
$#', $line, $matches)) {
$this->fail('git version output format unexpected: ' . $line);
$this->fail('git version output format unexpected: ' . $line);
+ return;
}
if (version_compare($matches[1], '1.7.5') < 0) {
$this->fail(
}
if (version_compare($matches[1], '1.7.5') < 0) {
$this->fail(
@@
-129,8
+140,13
@@
class SetupCheck
public function checkMimeTypeDetection()
{
$rp = new Repository_Post();
public function checkMimeTypeDetection()
{
$rp = new Repository_Post();
- if ($rp->getType('<?php echo "foo"; ?>') != 'php') {
- $this->fail('MIME type detection fails');
+ $type = $rp->getType('<?php echo "foo"; ?>', true);
+ if ($type != 'php') {
+ $msg = 'MIME type detection fails';
+ if ($type instanceof \PEAR_Error) {
+ $msg .= '. Error: ' . $type->getMessage();
+ }
+ $this->fail($msg);
}
}
}
}