/** * {@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()); }
/** * {@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; } } }
/** * {@inheritdoc} */ public function compare(PackageInterface $package, $operator = '==') { return strtolower($this->getName()) === strtolower($package->getName()) && version_compare(strtolower($this->getVersion()), strtolower($package->getVersion()), $operator); }
/** * {@inheritdoc} */ public function getInstallPath(PackageInterface $package) { return $this->path . '/' . $package->getName(); }