瀏覽代碼

Add dist properties to the Packages

Jordi Boggiano 13 年之前
父節點
當前提交
64978d40ba
共有 2 個文件被更改,包括 73 次插入1 次删除
  1. 51 0
      src/Composer/Package/MemoryPackage.php
  2. 22 1
      src/Composer/Package/PackageInterface.php

+ 51 - 0
src/Composer/Package/MemoryPackage.php

@@ -22,6 +22,9 @@ class MemoryPackage extends BasePackage
     protected $type;
     protected $sourceType;
     protected $sourceUrl;
+    protected $distType;
+    protected $distUrl;
+    protected $distSha1Checksum;
     protected $releaseType;
     protected $version;
     protected $license;
@@ -96,6 +99,54 @@ class MemoryPackage extends BasePackage
         return $this->sourceUrl;
     }
 
+    /**
+     * @param string $type
+     */
+    public function setDistType($type)
+    {
+        $this->distType = $type;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public function getDistType()
+    {
+        return $this->distType;
+    }
+
+    /**
+     * @param string $url
+     */
+    public function setDistUrl($url)
+    {
+        $this->distUrl = $url;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public function getDistUrl()
+    {
+        return $this->distUrl;
+    }
+
+    /**
+     * @param string $url
+     */
+    public function setDistSha1Checksum($sha1checksum)
+    {
+        $this->distSha1Checksum = $sha1checksum;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public function getDistSha1Checksum()
+    {
+        return $this->distSha1Checksum;
+    }
+
     /**
      * Set the release type
      *

+ 22 - 1
src/Composer/Package/PackageInterface.php

@@ -69,7 +69,7 @@ interface PackageInterface
     function getType();
 
     /**
-     * Returns the repository type of this package, e.g. git, svn, tar
+     * Returns the repository type of this package, e.g. git, svn
      *
      * @return string The repository type
      */
@@ -82,6 +82,27 @@ interface PackageInterface
      */
     function getSourceUrl();
 
+    /**
+     * Returns the type of the distribution archive of this version, e.g. zip, tarball
+     *
+     * @return string The repository type
+     */
+    function getDistType();
+
+    /**
+     * Returns the url of the distribution archive of this version
+     *
+     * @return string
+     */
+    function getDistUrl();
+
+    /**
+     * Returns the sha1 checksum for the distribution archive of this version
+     *
+     * @return string
+     */
+    function getDistSha1Checksum();
+
     /**
      * Returns the release type of this package, e.g. stable or beta
      *