From 2e9f57b6dd338bb0d458bec8415043570fcf40ea Mon Sep 17 00:00:00 2001 From: Beau Simensen Date: Mon, 16 Jul 2012 10:11:09 -0700 Subject: [PATCH] Get links from the pacakge --- src/Composer/Package/Loader/RootPackageLoader.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Composer/Package/Loader/RootPackageLoader.php b/src/Composer/Package/Loader/RootPackageLoader.php index 51c676112..8449d855d 100644 --- a/src/Composer/Package/Loader/RootPackageLoader.php +++ b/src/Composer/Package/Loader/RootPackageLoader.php @@ -69,9 +69,15 @@ class RootPackageLoader extends ArrayLoader $references = array(); foreach (array('require', 'require-dev') as $linkType) { if (isset($config[$linkType])) { - $aliases = $this->extractAliases($config[$linkType], $aliases); - $stabilityFlags = $this->extractStabilityFlags($config[$linkType], $stabilityFlags); - $references = $this->extractReferences($config[$linkType], $references); + $linkInfo = BasePackage::$supportedLinkTypes[$linkType]; + $method = 'get'.ucfirst($linkInfo['method']); + $links = array(); + foreach ($package->$method() as $link) { + $links[$link->getTarget()] = $link->getConstraint()->getPrettyString(); + } + $aliases = $this->extractAliases($links, $aliases); + $stabilityFlags = $this->extractStabilityFlags($links, $stabilityFlags); + $references = $this->extractReferences($links, $references); } }