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
/
Repository
/
Post.php
diff --git
a/src/phorkie/Repository/Post.php
b/src/phorkie/Repository/Post.php
index cf07b73a571590dedf532ef63e6cbdec59ba969b..a61f2a257e6f78709e49489bce9a1f4dfa063ba5 100644
(file)
--- a/
src/phorkie/Repository/Post.php
+++ b/
src/phorkie/Repository/Post.php
@@
-152,6
+152,7
@@
class Repository_Post
->setOption('message', "$notes")
->execute();
//update info for dumb git HTTP transport
->setOption('message', "$notes")
->execute();
//update info for dumb git HTTP transport
+ //the post-update hook should do that IMO, but does not somehow
$vc->getCommand('update-server-info')->execute();
$bChanged = true;
$vc->getCommand('update-server-info')->execute();
$bChanged = true;
@@
-231,13
+232,23
@@
class Repository_Post
return $prefix . $num;
}
return $prefix . $num;
}
- public function getType($content)
+ public function getType($content
, $returnError = false
)
{
{
+ if (getenv('PATH') == '') {
+ //php-fpm does not fill $PATH by default
+ // we have to work around that since System::which() uses it
+ putenv('PATH=/usr/local/bin:/usr/bin:/bin');
+ }
+
$tmp = tempnam(sys_get_temp_dir(), 'phorkie-autodetect-');
file_put_contents($tmp, $content);
$type = Tool_MIME_Type_PlainDetect::autoDetect($tmp);
unlink($tmp);
$tmp = tempnam(sys_get_temp_dir(), 'phorkie-autodetect-');
file_put_contents($tmp, $content);
$type = Tool_MIME_Type_PlainDetect::autoDetect($tmp);
unlink($tmp);
+ if ($returnError && $type instanceof \PEAR_Error) {
+ return $type;
+ }
+
return $this->findExtForType($type);
}
return $this->findExtForType($type);
}