1
0
Fork 0
pull/4207/merge
Jordi Boggiano 2016-02-29 15:04:05 +00:00
parent 6825c04a62
commit 0ed5b541a9
9 changed files with 17 additions and 13 deletions

View File

@ -60,7 +60,7 @@ EOT
// First assemble lookup list of packages that are installed, replaced or provided
$installed = array();
foreach($packages as $package) {
foreach ($packages as $package) {
$installed[] = $package['name'];
if (!empty($package['provide'])) {
@ -88,8 +88,9 @@ EOT
continue;
}
foreach ($package['suggest'] as $suggestion => $reason) {
if (false === strpos('/', $suggestion) && !is_null($platform->findPackage($suggestion, '*')))
if (false === strpos('/', $suggestion) && !is_null($platform->findPackage($suggestion, '*'))) {
continue;
}
if (!isset($installed[$suggestion])) {
$suggesters[$packageName][$suggestion] = $reason;
$suggested[$suggestion][$packageName] = $reason;
@ -114,6 +115,7 @@ EOT
foreach (array_keys($suggested) as $suggestion) {
$io->write(sprintf('<info>%s</info>', $suggestion));
}
return;
}

View File

@ -12,7 +12,6 @@
namespace Composer\Downloader;
use Composer\Config;
use Composer\Package\PackageInterface;
use Composer\IO\IOInterface;
use Composer\Util\Filesystem;
@ -313,6 +312,7 @@ class DownloadManager
if ('dist' === $preference || (!$package->isDev() && 'auto' === $preference)) {
return 'dist';
}
return 'source';
}
}

View File

@ -25,7 +25,7 @@ interface DvcsDownloaderInterface
* Checks for unpushed changes to a current branch
*
* @param PackageInterface $package package directory
* @param string $path package directory
* @param string $path package directory
* @return string|null changes or null
*/
public function getUnpushedChanges(PackageInterface $package, $path);

View File

@ -49,7 +49,7 @@ class PathDownloader extends FileDownloader
}
// Get the transport options with default values
$transportOptions = $package->getTransportOptions() + array('symlink'=>null);
$transportOptions = $package->getTransportOptions() + array('symlink' => null);
// When symlink transport option is null, both symlink and mirror are allowed
$currentStrategy = self::STRATEGY_SYMLINK;
@ -58,7 +58,7 @@ class PathDownloader extends FileDownloader
if (true === $transportOptions['symlink']) {
$currentStrategy = self::STRATEGY_SYMLINK;
$allowedStrategies = array(self::STRATEGY_SYMLINK);
} elseif(false === $transportOptions['symlink']) {
} elseif (false === $transportOptions['symlink']) {
$currentStrategy = self::STRATEGY_MIRROR;
$allowedStrategies = array(self::STRATEGY_MIRROR);
}

View File

@ -88,12 +88,12 @@ class RootPackageLoader extends ArrayLoader
$config['source'] = array(
'type' => '',
'url' => '',
'reference' => $commit
'reference' => $commit,
);
$config['dist'] = array(
'type' => '',
'url' => '',
'reference' => $commit
'reference' => $commit,
);
}
}

View File

@ -56,8 +56,8 @@ class VersionGuesser
}
/**
* @param array $packageConfig
* @param string $path Path to guess into
* @param array $packageConfig
* @param string $path Path to guess into
*
* @return array versionData, 'version' and 'commit' keys
*/
@ -136,8 +136,8 @@ class VersionGuesser
return $this->versionParser->normalize(trim($output));
} catch (\Exception $e) {
}
}
return null;
}
@ -236,9 +236,9 @@ class VersionGuesser
}
$version = $this->versionParser->normalize(trim($matches[1]));
return array('version' => $version, 'commit' => '');
}
}
}
}

View File

@ -639,6 +639,7 @@ class Filesystem
* #define _S_IFREG 0x8000
*/
$stat = lstat($junction);
return !($stat['mode'] & 0xC000);
}

View File

@ -244,6 +244,7 @@ class Perforce
return $value;
}
}
return null;
} else {
$command = 'echo $' . $name;

View File

@ -842,7 +842,7 @@ class DownloadManagerTest extends \PHPUnit_Framework_TestCase
$manager->download($package, 'target_dir');
}
/**
* @covers Composer\Downloader\DownloadManager::resolvePackageInstallPreference
*/