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
parent
ce082cd5b3
commit
8e4dffc055
|
@ -84,10 +84,12 @@ class Application extends BaseApplication
|
||||||
/** @var SignalHandler */
|
/** @var SignalHandler */
|
||||||
private $signalHandler;
|
private $signalHandler;
|
||||||
|
|
||||||
public function __construct()
|
public function __construct(string $name = 'Composer', string $version = '')
|
||||||
{
|
{
|
||||||
static $shutdownRegistered = false;
|
static $shutdownRegistered = false;
|
||||||
|
if ($version === '') {
|
||||||
|
$version = Composer::getVersion();
|
||||||
|
}
|
||||||
if (function_exists('ini_set') && extension_loaded('xdebug')) {
|
if (function_exists('ini_set') && extension_loaded('xdebug')) {
|
||||||
ini_set('xdebug.show_exception_trace', '0');
|
ini_set('xdebug.show_exception_trace', '0');
|
||||||
ini_set('xdebug.scream', '0');
|
ini_set('xdebug.scream', '0');
|
||||||
|
@ -121,7 +123,7 @@ class Application extends BaseApplication
|
||||||
|
|
||||||
$this->initialWorkingDirectory = getcwd();
|
$this->initialWorkingDirectory = getcwd();
|
||||||
|
|
||||||
parent::__construct('Composer', Composer::getVersion());
|
parent::__construct($name, $version);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function __destruct()
|
public function __destruct()
|
||||||
|
|
Loading…
Reference in New Issue