Use pretty name/version in lock file and debug:packages, fixes #98
parent
8df2436be8
commit
3b8ee5dd54
|
@ -50,12 +50,12 @@ EOT
|
|||
$installedRepo = new PlatformRepository($localRepo);
|
||||
|
||||
foreach ($installedRepo->getPackages() as $package) {
|
||||
$output->writeln('installed: '.$package->getName().' '.$package->getVersion());
|
||||
$output->writeln('installed: '.$package->getPrettyName().' '.$package->getPrettyVersion().' ('.$package->getName().' '.$package->getVersion().')');
|
||||
}
|
||||
|
||||
foreach ($composer->getRepositoryManager()->getRepositories() as $repository) {
|
||||
foreach ($repository->getPackages() as $package) {
|
||||
$output->writeln('available: '.$package->getName().' '.$package->getVersion());
|
||||
$output->writeln('available: '.$package->getPrettyName().' '.$package->getPrettyVersion().' ('.$package->getName().' '.$package->getVersion().')');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,7 +27,6 @@ class ArrayDumper
|
|||
'names',
|
||||
'extra',
|
||||
'installationSource' => 'installation-source',
|
||||
'version',
|
||||
'license',
|
||||
'requires',
|
||||
'conflicts',
|
||||
|
@ -41,6 +40,7 @@ class ArrayDumper
|
|||
|
||||
$data = array();
|
||||
$data['name'] = $package->getPrettyName();
|
||||
$data['version'] = $package->getPrettyVersion();
|
||||
if ($package->getTargetDir()) {
|
||||
$data['target-dir'] = $package->getTargetDir();
|
||||
}
|
||||
|
|
|
@ -89,8 +89,8 @@ class Locker
|
|||
{
|
||||
$hash = array();
|
||||
foreach ($packages as $package) {
|
||||
$name = $package->getName();
|
||||
$version = $package->getVersion();
|
||||
$name = $package->getPrettyName();
|
||||
$version = $package->getPrettyVersion();
|
||||
|
||||
if (!$name || !$version) {
|
||||
throw new \LogicException(sprintf(
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
namespace Composer\Repository;
|
||||
|
||||
use Composer\Package\PackageInterface;
|
||||
use Composer\Package\Version\VersionParser;
|
||||
|
||||
/**
|
||||
* A repository implementation that simply stores packages in an array
|
||||
|
@ -29,6 +30,11 @@ class ArrayRepository implements RepositoryInterface
|
|||
*/
|
||||
public function findPackage($name, $version)
|
||||
{
|
||||
// normalize version & name
|
||||
$versionParser = new VersionParser();
|
||||
$version = $versionParser->normalize($version);
|
||||
$name = strtolower($name);
|
||||
|
||||
foreach ($this->getPackages() as $package) {
|
||||
if ($name === $package->getName() && $version === $package->getVersion()) {
|
||||
return $package;
|
||||
|
|
Loading…
Reference in New Issue