1
0
Fork 0

Fix undef variable in search, fixes #374

pull/375/merge
Jordi Boggiano 2012-02-29 21:03:48 +01:00
parent 5d414436ba
commit 30f612f672
1 changed files with 8 additions and 2 deletions

View File

@ -62,12 +62,18 @@ EOT
continue;
}
$state = $localRepo->hasPackage($package) ? '<info>installed</info>' : $state = '<comment>available</comment>';
if ($platformRepo->hasPackage($package)) {
$type = '<info>platform: </info> ';
} elseif ($installedRepo->hasPackage($package)) {
$type = '<info>installed:</info> ';
} else {
$type = '<comment>available:</comment> ';
}
$name = substr($package->getPrettyName(), 0, $pos)
. '<highlight>' . substr($package->getPrettyName(), $pos, strlen($token)) . '</highlight>'
. substr($package->getPrettyName(), $pos + strlen($token));
$output->writeln($state . ': ' . $name . ' <comment>' . $package->getPrettyVersion() . '</comment>');
$output->writeln($type . ': ' . $name . ' <comment>' . $package->getPrettyVersion() . '</comment>');
continue 2;
}
}