fix historic binary file downloads
authorChristian Weiske <cweiske@cweiske.de>
Tue, 17 Apr 2012 20:02:27 +0000 (22:02 +0200)
committerChristian Weiske <cweiske@cweiske.de>
Tue, 17 Apr 2012 20:02:27 +0000 (22:02 +0200)
src/phorkie/File.php
src/phorkie/GitCommandBinary.php [new file with mode: 0644]

index acc44cd884468e45ee8248dc8740e3a8661476c8..188c255918f8f0cbb44b983b4a94ac923f7ce274 100644 (file)
@@ -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();
         }
diff --git a/src/phorkie/GitCommandBinary.php b/src/phorkie/GitCommandBinary.php
new file mode 100644 (file)
index 0000000..13a31db
--- /dev/null
@@ -0,0 +1,15 @@
+<?php
+namespace phorkie;
+
+class GitCommandBinary extends \VersionControl_Git_Util_Command
+{
+    /**
+     * Do not strip anything, we're accessing binary files
+     */
+    public function stripEscapeSequence($string)
+    {
+        return $string;
+    }
+}
+
+?>
\ No newline at end of file