X-Git-Url: https://git.cweiske.de/phorkie.git/blobdiff_plain/8406133d01bfc5fc6c5ed95735e45d7a4adfbb41..39e0a6893c7f5c31cdbc89633c37525fd62bac46:/src/phorkie/File.php diff --git a/src/phorkie/File.php b/src/phorkie/File.php index bc0950f..188c255 100644 --- a/src/phorkie/File.php +++ b/src/phorkie/File.php @@ -61,7 +61,11 @@ class File public function getContent() { if ($this->repo->hash) { - return $this->repo->getVc()->getCommand('show') + //quick hack until https://pear.php.net/bugs/bug.php?id=19385 is fixed + $cmd = new GitCommandBinary($this->repo->getVc()); + $cmd->setSubCommand('show'); + return //$this->repo->getVc()->getCommand('show') + $cmd ->addArgument($this->repo->hash . ':' . $this->path) ->execute(); } @@ -102,7 +106,12 @@ class File public function getLink($type, $option = null) { if ($type == 'raw') { - return '/' . $this->repo->id . '/raw/' . $this->getFilename(); + if ($this->repo->hash === null) { + return '/' . $this->repo->id . '/raw/' . $this->getFilename(); + } else { + return '/' . $this->repo->id . '/rev-raw/' . $this->repo->hash + . '/' . $this->getFilename(); + } } else if ($type == 'tool') { return '/' . $this->repo->id . '/tool/' . $option . '/' . $this->getFilename(); }