瀏覽代碼

Store autoload information

Jordi Boggiano 13 年之前
父節點
當前提交
410b01b700
共有 2 個文件被更改,包括 30 次插入0 次删除
  1. 4 0
      src/Packagist/WebBundle/Command/UpdatePackagesCommand.php
  2. 26 0
      src/Packagist/WebBundle/Entity/Version.php

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

@@ -218,6 +218,10 @@ EOF
             $version->setTargetDir($data['target-dir']);
         }
 
+        if (isset($data['autoload'])) {
+            $version->setAutoload($data['autoload']);
+        }
+
         if (isset($data['extra']) && is_array($data['extra'])) {
             $version->setExtra($data['extra']);
         }

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

@@ -151,6 +151,11 @@ class Version
      */
     private $dist;
 
+    /**
+     * @ORM\Column(type="text", nullable=true)
+     */
+    private $autoload;
+
     /**
      * @ORM\Column(type="datetime")
      */
@@ -205,6 +210,7 @@ class Version
             'dist' => $this->getDist(),
             'type' => $this->getType(),
             'target-dir' => $this->getTargetDir(),
+            'autoload' => $this->getAutoload(),
             'extra' => $this->getExtra(),
         );
 
@@ -403,6 +409,26 @@ class Version
         return json_decode($this->dist, true);
     }
 
+    /**
+     * Set autoload
+     *
+     * @param string $autoload
+     */
+    public function setAutoload($autoload)
+    {
+        $this->autoload = json_encode($autoload);
+    }
+
+    /**
+     * Get autoload
+     *
+     * @return text
+     */
+    public function getAutoload()
+    {
+        return json_decode($this->autoload, true);
+    }
+
     /**
      * Set createdAt
      *