コード例 #1
0
 /**
  * {@inheritdoc}
  */
 public function download(PackageInterface $package, $path)
 {
     if (!($url = $package->getDistUrl())) {
         throw new UnexpectedValueException("The given package is missing url information");
     }
     $this->downloadFile($path, $url, $package->getDistSha1Checksum());
 }
コード例 #2
0
 /**
  * {@inheritdoc}
  */
 public function removePackage(PackageInterface $package)
 {
     $packageId = $package->getUniqueName();
     foreach ($this->getPackages() as $key => $repoPackage) {
         if ($packageId === $repoPackage->getUniqueName()) {
             array_splice($this->packages, $key, 1);
             return;
         }
     }
 }
コード例 #3
0
 /**
  * {@inheritdoc}
  */
 public function compare(PackageInterface $package, $operator = '==')
 {
     return strtolower($this->getName()) === strtolower($package->getName()) && version_compare(strtolower($this->getVersion()), strtolower($package->getVersion()), $operator);
 }
コード例 #4
0
 /**
  * {@inheritdoc}
  */
 public function getInstallPath(PackageInterface $package)
 {
     return $this->path . '/' . $package->getName();
 }