aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/install/install_update.php
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2014-03-14 14:04:30 +0100
committerJoas Schilling <nickvergessen@gmx.de>2014-03-14 14:04:30 +0100
commit0aa23d203ef8760bd4f536b4eeaa6e9022c68eee (patch)
tree725cca559d663efe32e9864514ff75b787d1cd57 /phpBB/install/install_update.php
parentc743e28b94e2764b23c6e7da0e8e8d3452aec71e (diff)
parent60d2c1f4006894f2bb4fa310372734d02565e9ca (diff)
downloadforums-0aa23d203ef8760bd4f536b4eeaa6e9022c68eee.tar
forums-0aa23d203ef8760bd4f536b4eeaa6e9022c68eee.tar.gz
forums-0aa23d203ef8760bd4f536b4eeaa6e9022c68eee.tar.bz2
forums-0aa23d203ef8760bd4f536b4eeaa6e9022c68eee.tar.xz
forums-0aa23d203ef8760bd4f536b4eeaa6e9022c68eee.zip
Merge remote-tracking branch 'EXreaction/ticket/9871-2' into develop
* EXreaction/ticket/9871-2: [ticket/9871] Can set current version to use instead of the phpBB version [ticket/9871] Fix indentation on comment [ticket/9871] Fix test name [ticket/9871] Split fast and slow version tests [ticket/9871] Option to force the stability when checking for updates [ticket/9871] Allow setting the host/file to load for the version class [ticket/9871] Restore get_remote_file_test [ticket/9871] Fix tests [ticket/9871] Typehint and comment on var types [ticket/9871] Mark test as slow [ticket/9871] Restore phpbb_version_compare [ticket/9871] Restore get_remote_file [ticket/9871] Use $request->variable instead of request_var [ticket/9871] Update version check file to use json format
Diffstat (limited to 'phpBB/install/install_update.php')
-rw-r--r--phpBB/install/install_update.php50
1 files changed, 14 insertions, 36 deletions
diff --git a/phpBB/install/install_update.php b/phpBB/install/install_update.php
index dc6e57c851..5891efb375 100644
--- a/phpBB/install/install_update.php
+++ b/phpBB/install/install_update.php
@@ -154,14 +154,23 @@ class install_update extends module
));
// Get current and latest version
- if (($latest_version = $cache->get('_version_info')) === false)
+ $version_helper = $phpbb_container->get('version_helper');
+ try
{
- $this->latest_version = $this->get_file('version_info');
- $cache->put('_version_info', $this->latest_version);
+ $this->latest_version = $version_helper->get_latest_on_current_branch(true);
}
- else
+ catch (\RuntimeException $e)
{
- $this->latest_version = $latest_version;
+ $this->latest_version = false;
+
+ $update_info = array();
+ include($phpbb_root_path . 'install/update/index.' . $phpEx);
+ $info = (empty($update_info) || !is_array($update_info)) ? false : $update_info;
+
+ if ($info !== false)
+ {
+ $this->latest_version = (!empty($info['version']['to'])) ? trim($info['version']['to']) : false;
+ }
}
// For the current version we trick a bit. ;)
@@ -1606,37 +1615,6 @@ class install_update extends module
switch ($mode)
{
- case 'version_info':
- global $phpbb_root_path, $phpEx;
-
- $info = get_remote_file('version.phpbb.com', '/phpbb',
- ((defined('PHPBB_QA')) ? '30x_qa.txt' : '30x.txt'), $errstr, $errno);
-
- if ($info !== false)
- {
- $info = explode("\n", $info);
- $info = trim($info[0]);
- }
-
- if ($this->test_update !== false)
- {
- $info = $this->test_update;
- }
-
- // If info is false the fsockopen function may not be working. Instead get the latest version from our update file (and pray it is up-to-date)
- if ($info === false)
- {
- $update_info = array();
- include($phpbb_root_path . 'install/update/index.' . $phpEx);
- $info = (empty($update_info) || !is_array($update_info)) ? false : $update_info;
-
- if ($info !== false)
- {
- $info = (!empty($info['version']['to'])) ? trim($info['version']['to']) : false;
- }
- }
- break;
-
case 'update_info':
global $phpbb_root_path, $phpEx;