Browse Source

Add binaries support

Jordi Boggiano 13 years ago
parent
commit
458eee422e

+ 1 - 0
src/Packagist/WebBundle/Command/UpdatePackagesCommand.php

@@ -206,6 +206,7 @@ EOF
         $version->setTargetDir($data->getTargetDir());
         $version->setAutoload($data->getAutoload());
         $version->setExtra($data->getExtra());
+        $version->setBinaries($data->getBinaries());
 
         $version->getTags()->clear();
         if ($data->getKeywords()) {

+ 29 - 0
src/Packagist/WebBundle/Entity/Version.php

@@ -156,6 +156,11 @@ class Version
      */
     private $autoload;
 
+    /**
+     * @ORM\Column(type="text", nullable=true)
+     */
+    private $binaries;
+
     /**
      * @ORM\Column(type="datetime")
      */
@@ -213,6 +218,10 @@ class Version
             'extra' => $this->getExtra(),
         );
 
+        if ($this->getBinaries()) {
+            $data['bin'] = $this->getBinaries();
+        }
+
         $supportedLinkTypes = array(
             'require',
             'conflict',
@@ -428,6 +437,26 @@ class Version
         return json_decode($this->autoload, true);
     }
 
+    /**
+     * Set binaries
+     *
+     * @param string $binaries
+     */
+    public function setBinaries($binaries)
+    {
+        $this->binaries = json_encode($binaries);
+    }
+
+    /**
+     * Get binaries
+     *
+     * @return text
+     */
+    public function getBinaries()
+    {
+        return json_decode($this->binaries, true);
+    }
+
     /**
      * Set createdAt
      *