1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 22:10:45 +02:00

Merge branch '3.1.x' into 3.2.x

* 3.1.x:
  [ticket/14968] Use earlier version as written in comment
  [ticket/14968] Update docblock and ensure method returns array
  [ticket/14968] Display possible upgrade on acp index and update page
  [ticket/14968] Add method for retrieving updates on current branch
This commit is contained in:
Tristan Darricau
2017-01-22 23:15:26 +01:00
7 changed files with 273 additions and 4 deletions

View File

@@ -439,14 +439,22 @@ class acp_main
if ($auth->acl_get('a_board'))
{
/* @var $version_helper \phpbb\version_helper */
$version_helper = $phpbb_container->get('version_helper');
try
{
$recheck = $request->variable('versioncheck_force', false);
$updates_available = $version_helper->get_suggested_updates($recheck);
$updates_available = $version_helper->get_update_on_branch($recheck);
$upgrades_available = $version_helper->get_suggested_updates();
if (!empty($upgrades_available))
{
$upgrades_available = array_pop($upgrades_available);
}
$template->assign_var('S_VERSION_UP_TO_DATE', empty($updates_available));
$template->assign_vars(array(
'S_VERSION_UP_TO_DATE' => empty($updates_available),
'S_VERSION_UPGRADEABLE' => !empty($upgrades_available),
'UPGRADE_INSTRUCTIONS' => !empty($upgrades_available) ? $user->lang('UPGRADE_INSTRUCTIONS', $upgrades_available['current'], $upgrades_available['announcement']) : false,
));
}
catch (\RuntimeException $e)
{

View File

@@ -38,7 +38,12 @@ class acp_update
try
{
$recheck = $request->variable('versioncheck_force', false);
$updates_available = $version_helper->get_suggested_updates($recheck);
$updates_available = $version_helper->get_update_on_branch($recheck);
$upgrades_available = $version_helper->get_suggested_updates();
if (!empty($upgrades_available))
{
$upgrades_available = array_pop($upgrades_available);
}
}
catch (\RuntimeException $e)
{
@@ -62,6 +67,8 @@ class acp_update
'CURRENT_VERSION' => $config['version'],
'UPDATE_INSTRUCTIONS' => sprintf($user->lang['UPDATE_INSTRUCTIONS'], $update_link),
'S_VERSION_UPGRADEABLE' => !empty($upgrades_available),
'UPGRADE_INSTRUCTIONS' => !empty($upgrades_available) ? $user->lang('UPGRADE_INSTRUCTIONS', $upgrades_available['current'], $upgrades_available['announcement']) : false,
));
// Incomplete update?