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
|
||||
{
|
||||
protected $versionParser;
|
||||
protected $loadOptions;
|
||||
|
||||
public function __construct(VersionParser $parser = null)
|
||||
public function __construct(VersionParser $parser = null, $loadOptions = false)
|
||||
{
|
||||
if (!$parser) {
|
||||
$parser = new VersionParser;
|
||||
}
|
||||
$this->versionParser = $parser;
|
||||
$this->loadOptions = $loadOptions;
|
||||
}
|
||||
|
||||
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']);
|
||||
}
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ class Locker
|
|||
$this->repositoryManager = $repositoryManager;
|
||||
$this->installationManager = $installationManager;
|
||||
$this->hash = $hash;
|
||||
$this->loader = new ArrayLoader();
|
||||
$this->loader = new ArrayLoader(null, true);
|
||||
$this->dumper = new ArrayDumper();
|
||||
$this->process = new ProcessExecutor($io);
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ class ArrayLoaderTest extends \PHPUnit_Framework_TestCase
|
|||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->loader = new ArrayLoader();
|
||||
$this->loader = new ArrayLoader(null, true);
|
||||
}
|
||||
|
||||
public function testSelfVersion()
|
||||
|
|
Loading…
Reference in New Issue