Added option to automatically use latest build version from database

This commit is contained in:
mkuba50 2018-06-14 19:40:51 +02:00
parent ac0e30ecdf
commit bce954d9dc
2 changed files with 22 additions and 2 deletions

View File

@ -19,7 +19,7 @@ require_once dirname(__FILE__).'/shared/main.php';
require_once dirname(__FILE__).'/shared/requests.php'; require_once dirname(__FILE__).'/shared/requests.php';
require_once dirname(__FILE__).'/listid.php'; require_once dirname(__FILE__).'/listid.php';
function uupFetchUpd($arch = 'amd64', $ring = 'WIF', $flight = 'Active', $build = '16251', $minor = '0', $sku = '48') { function uupFetchUpd($arch = 'amd64', $ring = 'WIF', $flight = 'Active', $build = 'latest', $minor = '0', $sku = '48') {
uupApiPrintBrand(); uupApiPrintBrand();
$arch = strtolower($arch); $arch = strtolower($arch);
@ -27,6 +27,26 @@ function uupFetchUpd($arch = 'amd64', $ring = 'WIF', $flight = 'Active', $build
$flight = ucwords(strtolower($flight)); $flight = ucwords(strtolower($flight));
if($flight == 'Current') $flight = 'Active'; if($flight == 'Current') $flight = 'Active';
if($build == 'latest' || (!$build)) {
$builds = array('17134.1');
$ids = uupListIds();
if(isset($ids['error'])) {
$ids['builds'] = array();
}
$ids = $ids['builds'];
foreach($ids as $val) {
$builds[] = $val['build'];
}
$builds = array_unique($builds);
rsort($builds);
$build = $builds[0];
unset($builds, $ids);
}
$build = explode('.', $build); $build = explode('.', $build);
if(isset($build[1])) $minor = intval($build[1]); if(isset($build[1])) $minor = intval($build[1]);
$build = intval($build[0]); $build = intval($build[0]);

View File

@ -16,7 +16,7 @@ limitations under the License.
*/ */
function uupApiVersion() { function uupApiVersion() {
return '1.14.4'; return '1.15.0';
} }
function uupApiPrintBrand() { function uupApiPrintBrand() {