diff options
author | Tristan Darricau <github@nicofuma.fr> | 2016-09-01 16:12:04 +0200 |
---|---|---|
committer | Tristan Darricau <github@nicofuma.fr> | 2016-12-03 16:37:36 +0100 |
commit | 57915a8aaa842064d42fee419c9e0eaf7288140a (patch) | |
tree | cf303c8a91d80e1fc593b17e23e291fa68ff75eb /phpBB/phpbb | |
parent | ab58bb8744b98478437cefd7af362aea1274621e (diff) | |
download | forums-57915a8aaa842064d42fee419c9e0eaf7288140a.tar forums-57915a8aaa842064d42fee419c9e0eaf7288140a.tar.gz forums-57915a8aaa842064d42fee419c9e0eaf7288140a.tar.bz2 forums-57915a8aaa842064d42fee419c9e0eaf7288140a.tar.xz forums-57915a8aaa842064d42fee419c9e0eaf7288140a.zip |
[ticket/12610] Correctly handle empty cache
PHPBB3-12610
Diffstat (limited to 'phpBB/phpbb')
-rw-r--r-- | phpBB/phpbb/exception/version_check_exception.php | 21 | ||||
-rw-r--r-- | phpBB/phpbb/version_helper.php | 16 |
2 files changed, 29 insertions, 8 deletions
diff --git a/phpBB/phpbb/exception/version_check_exception.php b/phpBB/phpbb/exception/version_check_exception.php new file mode 100644 index 0000000000..0810263ade --- /dev/null +++ b/phpBB/phpbb/exception/version_check_exception.php @@ -0,0 +1,21 @@ +<?php +/** +* +* This file is part of the phpBB Forum Software package. +* +* @copyright (c) phpBB Limited <https://www.phpbb.com> +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\exception; + +/** + * Define an exception related to the version checker. + */ +class version_check_exception extends runtime_exception +{ +} diff --git a/phpBB/phpbb/version_helper.php b/phpBB/phpbb/version_helper.php index b1dcdf10d9..17caaa4a60 100644 --- a/phpBB/phpbb/version_helper.php +++ b/phpBB/phpbb/version_helper.php @@ -13,7 +13,7 @@ namespace phpbb; -use phpbb\exception\runtime_exception; +use phpbb\exception\version_check_exception; /** * Class to handle version checking and comparison @@ -172,7 +172,7 @@ class version_helper * @param bool $force_update Ignores cached data. Defaults to false. * @param bool $force_cache Force the use of the cache. Override $force_update. * @return string - * @throws runtime_exception + * @throws version_check_exception */ public function get_latest_on_current_branch($force_update = false, $force_cache = false) { @@ -203,7 +203,7 @@ class version_helper * @param bool $force_update Ignores cached data. Defaults to false. * @param bool $force_cache Force the use of the cache. Override $force_update. * @return string - * @throws runtime_exception + * @throws version_check_exception */ public function get_suggested_updates($force_update = false, $force_cache = false) { @@ -224,7 +224,7 @@ class version_helper * @param bool $force_update Ignores cached data. Defaults to false. * @param bool $force_cache Force the use of the cache. Override $force_update. * @return string Version info - * @throws runtime_exception + * @throws version_check_exception */ public function get_versions_matching_stability($force_update = false, $force_cache = false) { @@ -244,7 +244,7 @@ class version_helper * @param bool $force_update Ignores cached data. Defaults to false. * @param bool $force_cache Force the use of the cache. Override $force_update. * @return string Version info, includes stable and unstable data - * @throws runtime_exception + * @throws version_check_exception */ public function get_versions($force_update = false, $force_cache = false) { @@ -254,7 +254,7 @@ class version_helper if ($info === false && $force_cache) { - throw new runtime_exception('VERSIONCHECK_FAIL'); + throw new version_check_exception('VERSIONCHECK_FAIL'); } else if ($info === false || $force_update) { @@ -263,7 +263,7 @@ class version_helper if (!empty($error_string)) { - throw new runtime_exception($error_string); + throw new version_check_exception($error_string); } $info = json_decode($info, true); @@ -280,7 +280,7 @@ class version_helper if (empty($info['stable']) && empty($info['unstable'])) { - throw new runtime_exception('VERSIONCHECK_FAIL'); + throw new version_check_exception('VERSIONCHECK_FAIL'); } $info['stable'] = (empty($info['stable'])) ? array() : $info['stable']; |