1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[ticket/16688] Fix PHP fatal errors on installing extensions via catalog

PHPBB3-16688
This commit is contained in:
rxu
2021-12-18 12:18:24 +07:00
parent 7911c9cb73
commit d4d26987e5
2 changed files with 21 additions and 1 deletions

View File

@@ -152,7 +152,9 @@ class installer
{
if (!$io)
{
$this->restore_cwd();
$io = new null_io();
$this->move_to_root();
}
$this->generate_ext_json_file($packages);
@@ -183,6 +185,7 @@ class installer
}
catch (\Exception $e)
{
$this->restore_cwd();
$this->restore_ext_json_file();
throw new runtime_exception('COMPOSER_CANNOT_INSTALL', [], $e);
@@ -190,6 +193,7 @@ class installer
if ($result !== 0)
{
$this->restore_cwd();
$this->restore_ext_json_file();
throw new runtime_exception($io->get_composer_error(), []);