Only load options when they come from the lock file, not from standard metadata, refs #2189
parent
016a016455
commit
31092843fd
|
@ -25,13 +25,15 @@ use Composer\Package\Version\VersionParser;
|
||||||
class ArrayLoader implements LoaderInterface
|
class ArrayLoader implements LoaderInterface
|
||||||
{
|
{
|
||||||
protected $versionParser;
|
protected $versionParser;
|
||||||
|
protected $loadOptions;
|
||||||
|
|
||||||
public function __construct(VersionParser $parser = null)
|
public function __construct(VersionParser $parser = null, $loadOptions = false)
|
||||||
{
|
{
|
||||||
if (!$parser) {
|
if (!$parser) {
|
||||||
$parser = new VersionParser;
|
$parser = new VersionParser;
|
||||||
}
|
}
|
||||||
$this->versionParser = $parser;
|
$this->versionParser = $parser;
|
||||||
|
$this->loadOptions = $loadOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function load(array $config, $class = 'Composer\Package\CompletePackage')
|
public function load(array $config, $class = 'Composer\Package\CompletePackage')
|
||||||
|
@ -197,7 +199,7 @@ class ArrayLoader implements LoaderInterface
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($config['options'])) {
|
if ($this->loadOptions && isset($config['options'])) {
|
||||||
$package->setOptions($config['options']);
|
$package->setOptions($config['options']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,7 @@ class Locker
|
||||||
$this->repositoryManager = $repositoryManager;
|
$this->repositoryManager = $repositoryManager;
|
||||||
$this->installationManager = $installationManager;
|
$this->installationManager = $installationManager;
|
||||||
$this->hash = $hash;
|
$this->hash = $hash;
|
||||||
$this->loader = new ArrayLoader();
|
$this->loader = new ArrayLoader(null, true);
|
||||||
$this->dumper = new ArrayDumper();
|
$this->dumper = new ArrayDumper();
|
||||||
$this->process = new ProcessExecutor($io);
|
$this->process = new ProcessExecutor($io);
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ class ArrayLoaderTest extends \PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
public function setUp()
|
public function setUp()
|
||||||
{
|
{
|
||||||
$this->loader = new ArrayLoader();
|
$this->loader = new ArrayLoader(null, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testSelfVersion()
|
public function testSelfVersion()
|
||||||
|
|
Loading…
Reference in New Issue