Repository options must be replicated on package when dist file is under
repository base dirpull/2189/head
parent
8630aab93f
commit
0b77a59af6
|
@ -13,6 +13,7 @@
|
|||
namespace Composer\Repository;
|
||||
|
||||
use Composer\Package\Loader\ArrayLoader;
|
||||
use Composer\Package\Package;
|
||||
use Composer\Package\PackageInterface;
|
||||
use Composer\Package\AliasPackage;
|
||||
use Composer\Package\Version\VersionParser;
|
||||
|
@ -204,10 +205,19 @@ class ComposerRepository extends ArrayRepository implements StreamableRepository
|
|||
$package = $package->getAliasOf();
|
||||
}
|
||||
$package->setRepository($this);
|
||||
$this->configurePackageOptions($package);
|
||||
|
||||
return $package;
|
||||
}
|
||||
|
||||
protected function configurePackageOptions(PackageInterface $package)
|
||||
{
|
||||
if ($package instanceof Package
|
||||
&& strpos($package->getDistUrl(), $this->baseUrl) === 0) {
|
||||
$package->setOptions($this->options);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
|
@ -376,6 +386,17 @@ class ComposerRepository extends ArrayRepository implements StreamableRepository
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a new package to the repository
|
||||
*
|
||||
* @param PackageInterface $package
|
||||
*/
|
||||
public function addPackage(PackageInterface $package)
|
||||
{
|
||||
parent::addPackage($package);
|
||||
$this->configurePackageOptions($package);
|
||||
}
|
||||
|
||||
protected function loadRootServerFile()
|
||||
{
|
||||
if (null !== $this->rootData) {
|
||||
|
|
Loading…
Reference in New Issue