Example #1
0
 /**
  * Adds a new package to the repository
  *
  * @param PackageInterface $package
  */
 public function addPackage(PackageInterface $package)
 {
     if (null === $this->packages) {
         $this->initialize();
     }
     $package->setRepository($this);
     $this->packages[] = $package;
 }
Example #2
0
 /**
  * Adds a new package to the repository
  *
  * @param PackageInterface $package
  */
 public function addPackage(PackageInterface $package)
 {
     if (null === $this->packages) {
         $this->initialize();
     }
     $package->setRepository($this);
     $this->packages[] = $package;
     // create alias package on the fly if needed (installed repos manage aliases themselves)
     if ($package->getAlias() && !$this instanceof InstalledRepositoryInterface) {
         $this->addPackage($this->createAliasPackage($package));
     }
 }
Example #3
0
 public function addPackage(PackageInterface $package)
 {
     if (null === $this->packages) {
         $this->initialize();
     }
     $package->setRepository($this);
     $this->packages[] = $package;
     if ($package instanceof AliasPackage) {
         $aliasedPackage = $package->getAliasOf();
         if (null === $aliasedPackage->getRepository()) {
             $this->addPackage($aliasedPackage);
         }
     }
 }
Example #4
0
 /**
  * Adds a new package to the repository
  *
  * @param PackageInterface $package
  */
 public function addPackage(PackageInterface $package)
 {
     if (null === $this->packages) {
         $this->initialize();
     }
     $package->setRepository($this);
     $this->packages[] = $package;
     // create alias package on the fly if needed
     if ($package->getAlias()) {
         $alias = $this->createAliasPackage($package);
         if (!$this->hasPackage($alias)) {
             $this->addPackage($alias);
         }
     }
 }
Example #5
0
 /**
  * {@inheritdoc}
  */
 public function setRepository(RepositoryInterface $repository)
 {
     $this->package->setRepository($repository);
 }