mirror of
https://github.com/mbirth/tcl_update_db.git
synced 2024-11-10 07:16:46 +00:00
28 lines
577 B
PHP
28 lines
577 B
PHP
|
<?php
|
||
|
|
||
|
require_once __DIR__ . '/lib/autoloader.php';
|
||
|
|
||
|
use \TclUpdates\SQLiteReader;
|
||
|
|
||
|
$db = new SQLiteReader();
|
||
|
|
||
|
$refs = $db->getAllRefs();
|
||
|
$vars = $db->getAllVariantsFlat();
|
||
|
|
||
|
$output = array();
|
||
|
foreach ($refs as $ref) {
|
||
|
$lastOta = $db->getLatestUpdate($ref, $db::OTA_ONLY);
|
||
|
$lastFull = $db->getLatestUpdate($ref, $db::FULL_ONLY);
|
||
|
|
||
|
$output[$ref] = array(
|
||
|
'curef' => $ref,
|
||
|
'variant' => $vars[$ref],
|
||
|
'last_ota' => $lastOta['tv'],
|
||
|
'last_full' => $lastFull['tv'],
|
||
|
);
|
||
|
}
|
||
|
|
||
|
header('Content-Type: text/json');
|
||
|
|
||
|
echo json_encode($output);
|