1
0
Fork 0

Allow other CLIs (like satis in standalone mode) to re-brand composer. (#11118)

This affects the banner at the head of the help screen and the version info.
Symfony's base object offers the same signature but composer does not allow
to override it in constructor.
Yet there are public setter methods to change both after initializing the object.
This is the workaround satis cli currently uses.
pull/11079/merge
Ralf Lang 2022-10-13 14:10:27 +02:00 committed by GitHub
parent ce082cd5b3
commit 8e4dffc055
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -84,10 +84,12 @@ class Application extends BaseApplication
/** @var SignalHandler */
private $signalHandler;
public function __construct()
public function __construct(string $name = 'Composer', string $version = '')
{
static $shutdownRegistered = false;
if ($version === '') {
$version = Composer::getVersion();
}
if (function_exists('ini_set') && extension_loaded('xdebug')) {
ini_set('xdebug.show_exception_trace', '0');
ini_set('xdebug.scream', '0');
@ -121,7 +123,7 @@ class Application extends BaseApplication
$this->initialWorkingDirectory = getcwd();
parent::__construct('Composer', Composer::getVersion());
parent::__construct($name, $version);
}
public function __destruct()