瀏覽代碼

[autoload] add installAs field for use with autoloading

Igor Wiedler 13 年之前
父節點
當前提交
98ea8bccce
共有 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

@@ -188,6 +188,10 @@ EOF
             }
         }
 
+        if (isset($data['installAs'])) {
+            $version->setInstallAs($data['installAs']);
+        }
+
         if (isset($data['extra']) && is_array($data['extra'])) {
             $version->setExtra($data['extra']);
         }

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

@@ -48,6 +48,11 @@ class Version
      */
     private $type;
 
+    /**
+     * @ORM\Column(nullable="true")
+     */
+    private $installAs;
+
     /**
      * @ORM\Column(type="array", nullable="true")
      */
@@ -199,6 +204,7 @@ class Version
             'time' => $this->getReleasedAt() ? $this->getReleasedAt()->format('Y-m-d\TH:i:sP') : null,
             'dist' => $this->getDist(),
             'type' => $this->getType(),
+            'installAs' => $this->getInstallAs(),
             'extra' => $this->getExtra(),
         );
 
@@ -566,6 +572,26 @@ class Version
         return $this->type;
     }
 
+    /**
+     * Set installAs
+     *
+     * @param text $installAs
+     */
+    public function setInstallAs($installAs)
+    {
+        $this->installAs = $installAs;
+    }
+
+    /**
+     * Get installAs
+     *
+     * @return string
+     */
+    public function getInstallAs()
+    {
+        return $this->installAs;
+    }
+
     /**
      * Set extra
      *