From 6831bb17e904170bdbcc28887840f2a171cb284d Mon Sep 17 00:00:00 2001 From: eraseyourknees <112027564+eraseyourknees@users.noreply.github.com> Date: Tue, 13 Sep 2022 23:42:12 +0200 Subject: [PATCH] updateinfo.php: Adjust for the new fileinfo db --- updateinfo.php | 30 ++---------------------------- 1 file changed, 2 insertions(+), 28 deletions(-) diff --git a/updateinfo.php b/updateinfo.php index cd51183..60e6fc5 100644 --- a/updateinfo.php +++ b/updateinfo.php @@ -17,36 +17,10 @@ limitations under the License. require_once dirname(__FILE__).'/shared/main.php'; require_once dirname(__FILE__).'/shared/cache.php'; - -function uupApiPrivateGetFileinfo($updateId, $ignoreFiles) { - $cached = false; - - if($ignoreFiles) { - $res = "fileinfo-fileless-$updateId"; - $cache = new UupDumpCache($res, false); - $info = $cache->get(); - $cached = ($info !== false); - } - - if(!$cached) { - $info = @file_get_contents('fileinfo/'.$updateId.'.json'); - if(empty($info)) return false; - $info = json_decode($info, true); - } - - if($ignoreFiles) { - if(isset($info['files'])) unset($info['files']); - - if(!$cached) { - $cache->put($info, false); - } - } - - return $info; -} +require_once dirname(__FILE__).'/shared/fileinfo.php'; function uupUpdateInfo($updateId, $onlyInfo = 0, $ignoreFiles = false) { - $info = uupApiPrivateGetFileinfo($updateId, $ignoreFiles); + $info = uupApiReadFileinfo($updateId, $ignoreFiles); if($info === false) { return ['error' => 'UPDATE_INFORMATION_NOT_EXISTS']; }