1
0
Fork 0

Register ErrorHandler early to catch deprecation notices while the Application is being initialized

pull/10346/head
Jordi Boggiano 2021-07-22 12:57:55 +02:00 committed by David Zuelke
parent b8e5b1d2d4
commit ed9e9e9f9a
2 changed files with 5 additions and 0 deletions

View File

@ -10,6 +10,7 @@ require __DIR__.'/../src/bootstrap.php';
use Composer\Console\Application;
use Composer\XdebugHandler\XdebugHandler;
use Composer\Util\ErrorHandler;
error_reporting(-1);
@ -57,6 +58,8 @@ if (function_exists('ini_set')) {
putenv('COMPOSER_BINARY='.realpath($_SERVER['argv'][0]));
ErrorHandler::register();
// run the command application
$application = new Application();
$application->run();

View File

@ -127,6 +127,8 @@ class Application extends BaseApplication
$io = $this->io = new ConsoleIO($input, $output, new HelperSet(array(
new QuestionHelper(),
)));
// Register error handler again to pass it the IO instance
ErrorHandler::register($io);
if ($input->hasParameterOption('--no-cache')) {