1
0
www.mikescher.com/www/commands/progs_updatecheck.php
Mike Schwörer b28ca9238e
All checks were successful
Build Docker and Deploy / Build Docker (push) Successful in 11s
Build Docker and Deploy / Deploy to Server (push) Successful in 15s
Fix selftest when run in docker
2023-08-27 01:13:47 +02:00

22 lines
699 B
PHP

<?php
require_once (__DIR__ . '/../internals/website.php');
/** @var PageFrameOptions $FRAME_OPTIONS */ global $FRAME_OPTIONS;
/** @var URLRoute $ROUTE */ global $ROUTE;
/** @var Website $SITE */ global $SITE;
if (!isset($API_OPTIONS['name'])) { $FRAME_OPTIONS->forceResult(400, "Wrong parameters."); return; }
$name = urldecode($API_OPTIONS['name']);
$updatedata = $SITE->modules->UpdatesLog()->listUpdateData();
if (!array_key_exists($name, $updatedata)) { $FRAME_OPTIONS->forceResult(404, 'Invalid Request - [Name] not found'); return; }
$data = $updatedata[$name];
$SITE->modules->UpdatesLog()->insert($name, $data['version']);
print($name."<hr>".$data['version']."<hr>".$data['url']);