mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-09 10:16:36 +02:00
Merge pull request #6350 from rxu/ticket/16688
[ticket/16688] Fix PHP fatal errors on installing extensions via catalog
This commit is contained in:
@@ -60,7 +60,7 @@
|
||||
<td style="text-align: center;"><a href="{enabled.U_DETAILS}">{L_DETAILS}</a></td>
|
||||
<td style="text-align: center;">
|
||||
<!-- BEGIN actions -->
|
||||
<a href="{enabled.actions.U_ACTION}"<!-- IF enabled.actions.L_ACTION_EXPLAIN --> title="{enabled.actions.L_ACTION_EXPLAIN}"<!-- ENDIF -->>{enabled.actions.L_ACTION}</a>
|
||||
<a href="{enabled.actions.U_ACTION}"<!-- IF enabled.actions.ACTION == 'REMOVE' --> style="color: #bc2a4d;"<!-- ENDIF --><!-- IF enabled.actions.L_ACTION_EXPLAIN --> title="{enabled.actions.L_ACTION_EXPLAIN}"<!-- ENDIF -->>{enabled.actions.L_ACTION}</a>
|
||||
<!-- IF not enabled.actions.S_LAST_ROW --> | <!-- ENDIF -->
|
||||
<!-- END actions -->
|
||||
</td>
|
||||
@@ -88,7 +88,7 @@
|
||||
</td>
|
||||
<td style="text-align: center;">
|
||||
<!-- BEGIN actions -->
|
||||
<a href="{disabled.actions.U_ACTION}"<!-- IF disabled.actions.L_ACTION_EXPLAIN --> title="{disabled.actions.L_ACTION_EXPLAIN}"<!-- ENDIF -->>{disabled.actions.L_ACTION}</a>
|
||||
<a href="{disabled.actions.U_ACTION}"<!-- IF disabled.actions.ACTION == 'REMOVE' --> style="color: #bc2a4d;"<!-- ENDIF --><!-- IF disabled.actions.L_ACTION_EXPLAIN --> title="{disabled.actions.L_ACTION_EXPLAIN}"<!-- ENDIF -->>{disabled.actions.L_ACTION}</a>
|
||||
<!-- IF not disabled.actions.S_LAST_ROW --> | <!-- ENDIF -->
|
||||
<!-- END actions -->
|
||||
</td>
|
||||
|
@@ -838,10 +838,7 @@ class acp_extensions
|
||||
{
|
||||
$this->output_actions('enabled', [
|
||||
'UPDATE' => $this->u_catalog_action . '&action=update&extension=' . urlencode($block_vars['META_NAME']),
|
||||
'REMOVE' => [
|
||||
'url' => $this->u_catalog_action . '&action=remove&extension=' . urlencode($block_vars['META_NAME']),
|
||||
'color' => '#BC2A4D;',
|
||||
]
|
||||
'REMOVE' => $this->u_catalog_action . '&action=remove&extension=' . urlencode($block_vars['META_NAME']),
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -922,10 +919,7 @@ class acp_extensions
|
||||
{
|
||||
$this->output_actions('disabled', [
|
||||
'UPDATE' => $this->u_catalog_action . '&action=update&extension=' . urlencode($block_vars['META_NAME']),
|
||||
'REMOVE' => [
|
||||
'url' => $this->u_catalog_action . '&action=remove&extension=' . urlencode($block_vars['META_NAME']),
|
||||
'color' => '#BC2A4D;',
|
||||
]
|
||||
'REMOVE' => $this->u_catalog_action . '&action=remove&extension=' . urlencode($block_vars['META_NAME']),
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -997,6 +991,7 @@ class acp_extensions
|
||||
|
||||
$this->output_actions('disabled', array(
|
||||
'ENABLE' => $this->u_action . '&action=enable_pre&ext_name=' . urlencode($name),
|
||||
'REMOVE' => $this->u_catalog_action . '&action=remove&extension=' . urlencode($block_vars['META_NAME']),
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -1009,11 +1004,12 @@ class acp_extensions
|
||||
*/
|
||||
private function output_actions($block, $actions)
|
||||
{
|
||||
foreach ($actions as $lang => $url)
|
||||
foreach ($actions as $action => $url)
|
||||
{
|
||||
$this->template->assign_block_vars($block . '.actions', [
|
||||
'L_ACTION' => $this->user->lang('EXTENSION_' . $lang),
|
||||
'L_ACTION_EXPLAIN' => (isset($this->user->lang['EXTENSION_' . $lang . '_EXPLAIN'])) ? $this->user->lang('EXTENSION_' . $lang . '_EXPLAIN') : '',
|
||||
'ACTION' => $action,
|
||||
'L_ACTION' => $this->user->lang('EXTENSION_' . $action),
|
||||
'L_ACTION_EXPLAIN' => (isset($this->user->lang['EXTENSION_' . $action . '_EXPLAIN'])) ? $this->user->lang('EXTENSION_' . $action . '_EXPLAIN') : '',
|
||||
'U_ACTION' => $url,
|
||||
]);
|
||||
}
|
||||
|
@@ -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);
|
||||
@@ -184,6 +186,7 @@ class installer
|
||||
catch (\Exception $e)
|
||||
{
|
||||
$this->restore_ext_json_file();
|
||||
$this->restore_cwd();
|
||||
|
||||
throw new runtime_exception('COMPOSER_CANNOT_INSTALL', [], $e);
|
||||
}
|
||||
@@ -191,6 +194,7 @@ class installer
|
||||
if ($result !== 0)
|
||||
{
|
||||
$this->restore_ext_json_file();
|
||||
$this->restore_cwd();
|
||||
|
||||
throw new runtime_exception($io->get_composer_error(), []);
|
||||
}
|
||||
@@ -587,6 +591,7 @@ class installer
|
||||
$repositories[] = [
|
||||
'type' => 'composer',
|
||||
'url' => $repository,
|
||||
'canonical' => $this->packagist ? false : true,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@@ -89,7 +89,7 @@ class manager implements manager_interface
|
||||
$managed_packages = array_merge($this->get_all_managed_packages(), $packages);
|
||||
ksort($managed_packages);
|
||||
|
||||
$this->installer->install($managed_packages, array_keys($packages), $io);
|
||||
$this->installer->install($managed_packages, [], $io);
|
||||
|
||||
$this->post_install($packages, $io);
|
||||
|
||||
|
Reference in New Issue
Block a user