Skip to content

Commit

Permalink
Fixes wrong value returned when getting the vendor dir through Plugin…
Browse files Browse the repository at this point in the history
…Config

When using `\MagentoHackathon\Composer\Magento\ProjectConfig::getVendorDir()`, the passed array didn't contain the "vendor-dir" key, so the default value was always returned, irrelevant of the configuration in "composer.json".

Also, the said method must always return the absolute path to the vendor folder, as it's the case with Composer.
  • Loading branch information
adragus-inviqa committed May 1, 2015
1 parent 1903484 commit c1d88a1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/MagentoHackathon/Composer/Magento/ProjectConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,11 @@ public function getComposerRepositories()
*/
public function getVendorDir()
{
return $this->fetchVarFromConfigArray($this->composerConfig, 'vendor-dir', 'vendor');
return $this->fetchVarFromConfigArray(
$this->composerConfig['config'],
'vendor-dir',
getcwd() . '/vendor'
);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function setUp()
new InstalledPackageDumper()
);

$config = new ProjectConfig(array(), array('vendor-dir' => 'vendor'));
$config = new ProjectConfig(array(), array('config' => array('vendor-dir' => 'vendor')));
$this->unInstallStrategy =
$this->getMock('MagentoHackathon\Composer\Magento\UnInstallStrategy\UnInstallStrategyInterface');

Expand Down

0 comments on commit c1d88a1

Please sign in to comment.