Merge remote-tracking branch 'digitalkaoz/issue_366'
commit
4f61ec6600
|
@ -56,26 +56,31 @@ EOT
|
||||||
}
|
}
|
||||||
|
|
||||||
$tokens = array_map('strtolower', $input->getArgument('tokens'));
|
$tokens = array_map('strtolower', $input->getArgument('tokens'));
|
||||||
|
$packages = array();
|
||||||
|
|
||||||
foreach ($repos->getPackages() as $package) {
|
foreach ($repos->getPackages() as $package) {
|
||||||
foreach ($tokens as $token) {
|
foreach ($tokens as $token) {
|
||||||
if (false === ($pos = strpos($package->getName(), $token))) {
|
if (false === ($pos = strpos($package->getName(), $token)) && (false === strpos(join(',',$package->getKeywords() ?: array()), $token))) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($platformRepo->hasPackage($package)) {
|
if (false !== ($pos = strpos($package->getName(), $token))) {
|
||||||
$type = '<info>platform: </info> ';
|
$name = substr($package->getPrettyName(), 0, $pos)
|
||||||
} elseif ($installedRepo->hasPackage($package)) {
|
. '<highlight>' . substr($package->getPrettyName(), $pos, strlen($token)) . '</highlight>'
|
||||||
$type = '<info>installed:</info> ';
|
. substr($package->getPrettyName(), $pos + strlen($token));
|
||||||
} else {
|
} else {
|
||||||
$type = '<comment>available:</comment> ';
|
$name = $package->getPrettyName();
|
||||||
}
|
}
|
||||||
|
|
||||||
$name = substr($package->getPrettyName(), 0, $pos)
|
$version = $installedRepo->hasPackage($package) ? '<info>'.$package->getPrettyVersion().'</info>' : $package->getPrettyVersion();
|
||||||
. '<highlight>' . substr($package->getPrettyName(), $pos, strlen($token)) . '</highlight>'
|
|
||||||
. substr($package->getPrettyName(), $pos + strlen($token));
|
$packages[$name][$package->getPrettyVersion()] = $version;
|
||||||
$output->writeln($type . ': ' . $name . ' <comment>' . $package->getPrettyVersion() . '</comment>');
|
|
||||||
continue 2;
|
continue 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach ($packages as $name => $versions) {
|
||||||
|
$output->writeln($name .' <comment>:</comment> '. join(', ', $versions));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue