|
|
@ -15,6 +15,7 @@ namespace Composer\Installer;
|
|
|
|
use Composer\IO\IOInterface;
|
|
|
|
use Composer\IO\IOInterface;
|
|
|
|
use Composer\Package\PackageInterface;
|
|
|
|
use Composer\Package\PackageInterface;
|
|
|
|
use Composer\Repository\RepositoryInterface;
|
|
|
|
use Composer\Repository\RepositoryInterface;
|
|
|
|
|
|
|
|
use Symfony\Component\Console\Formatter\OutputFormatter;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Add suggested packages from different places to output them in the end.
|
|
|
|
* Add suggested packages from different places to output them in the end.
|
|
|
@ -116,11 +117,35 @@ class SuggestedPackagesReporter
|
|
|
|
$this->io->writeError(sprintf(
|
|
|
|
$this->io->writeError(sprintf(
|
|
|
|
'%s suggests installing %s (%s)',
|
|
|
|
'%s suggests installing %s (%s)',
|
|
|
|
$suggestion['source'],
|
|
|
|
$suggestion['source'],
|
|
|
|
$suggestion['target'],
|
|
|
|
$this->escapeOutput($suggestion['target']),
|
|
|
|
$suggestion['reason']
|
|
|
|
$this->escapeOutput($suggestion['reason'])
|
|
|
|
));
|
|
|
|
));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* @param string $string
|
|
|
|
|
|
|
|
* @return string
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
private function escapeOutput($string)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return OutputFormatter::escape(
|
|
|
|
|
|
|
|
$this->removeControlCharacters($string)
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* @param string $string
|
|
|
|
|
|
|
|
* @return string
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
private function removeControlCharacters($string)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return preg_replace(
|
|
|
|
|
|
|
|
'/[[:cntrl:]]/',
|
|
|
|
|
|
|
|
'',
|
|
|
|
|
|
|
|
str_replace("\n", ' ', $string)
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|