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

main
Jordi Boggiano 3 years ago
parent 5413faec49
commit 29a52ff463
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC

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

@ -139,6 +139,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')) {

Loading…
Cancel
Save