forked from uup-dump/api
Add checking if metadata ESD files exist
This commit is contained in:
parent
77745105e1
commit
d196812ce8
21
get.php
21
get.php
@ -60,6 +60,7 @@ function uupGetFiles($updateId = 'c2a1d787-647b-486d-b264-f90f3782cdc6', $usePac
|
||||
$packs = uupGetPacks($build);
|
||||
$packsForLangs = $packs['packsForLangs'];
|
||||
$editionPacks = $packs['editionPacks'];
|
||||
$checkEditions = $packs['allEditions'];
|
||||
$packs = $packs['packs'];
|
||||
|
||||
if($usePack) {
|
||||
@ -88,6 +89,8 @@ function uupGetFiles($updateId = 'c2a1d787-647b-486d-b264-f90f3782cdc6', $usePac
|
||||
return array('error' => 'UNSUPPORTED_COMBINATION');
|
||||
}
|
||||
unset($supported);
|
||||
|
||||
$checkEditions = array($desiredEdition);
|
||||
}
|
||||
|
||||
if($desiredEdition == 'UPDATEONLY') {
|
||||
@ -226,6 +229,24 @@ function uupGetFiles($updateId = 'c2a1d787-647b-486d-b264-f90f3782cdc6', $usePac
|
||||
}
|
||||
|
||||
if($usePack && $desiredEdition != 'UPDATEONLY') {
|
||||
$esd = array_keys($files);
|
||||
$esd = preg_grep('/\.esd$/i', $esd);
|
||||
|
||||
foreach($esd as $key => $val) {
|
||||
$esd[$key] = strtoupper($val);
|
||||
}
|
||||
|
||||
foreach($checkEditions as $val) {
|
||||
$testEsd[] = $val.'_'.strtoupper($usePack).'.ESD';
|
||||
}
|
||||
|
||||
$foundMetadata = array_intersect($testEsd, $esd);
|
||||
consoleLogger('Found '.count($foundMetadata).' metadata ESD file(s).');
|
||||
|
||||
if(empty($foundMetadata)) {
|
||||
return array('error' => 'NO_METADATA_ESD');
|
||||
}
|
||||
|
||||
$removeFiles = array();
|
||||
$removeFiles[0] = preg_grep('/RetailDemo-OfflineContent/i', $filesKeys);
|
||||
$removeFiles[1] = preg_grep('/Windows10\.0-KB.*-EXPRESS/i', $filesKeys);
|
||||
|
@ -16,7 +16,7 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
function uupApiVersion() {
|
||||
return '1.7.1';
|
||||
return '1.8.0';
|
||||
}
|
||||
|
||||
function uupApiPrintBrand() {
|
||||
|
@ -57,6 +57,90 @@ function uupGetPacks($build = 15063) {
|
||||
'zh-tw' => 'Chinese (Traditional)',
|
||||
);
|
||||
|
||||
$allEditions = array(
|
||||
'ANALOGONECORE',
|
||||
'CORE',
|
||||
'CORECOUNTRYSPECIFIC',
|
||||
'COREN',
|
||||
'CORESINGLELANGUAGE',
|
||||
'CORESYSTEMSERVER',
|
||||
'EDUCATION',
|
||||
'EDUCATIONN',
|
||||
'EMBEDDED',
|
||||
'EMBEDDEDE',
|
||||
'EMBEDDEDEEVAL',
|
||||
'EMBEDDEDEVAL',
|
||||
'ENTERPRISE',
|
||||
'ENTERPRISEEVAL',
|
||||
'ENTERPRISEG',
|
||||
'ENTERPRISEGN',
|
||||
'ENTERPRISEN',
|
||||
'ENTERPRISENEVAL',
|
||||
'ENTERPRISES',
|
||||
'ENTERPRISESEVAL',
|
||||
'ENTERPRISESN',
|
||||
'ENTERPRISESNEVAL',
|
||||
'IOTUAP',
|
||||
'PPIPRO',
|
||||
'PROFESSIONAL',
|
||||
'PROFESSIONALCOUNTRYSPECIFIC',
|
||||
'PROFESSIONALEDUCATION',
|
||||
'PROFESSIONALEDUCATIONN',
|
||||
'PROFESSIONALN',
|
||||
'PROFESSIONALSINGLELANGUAGE',
|
||||
'PROFESSIONALWORKSTATION',
|
||||
'PROFESSIONALWORKSTATIONN',
|
||||
'SERVERARM64',
|
||||
'SERVERARM64CORE',
|
||||
'SERVERAZURECOR',
|
||||
'SERVERAZURECORCORE',
|
||||
'SERVERAZURENANO',
|
||||
'SERVERAZURENANOCORE',
|
||||
'SERVERCLOUDSTORAGE',
|
||||
'SERVERCLOUDSTORAGECORE',
|
||||
'SERVERDATACENTER',
|
||||
'SERVERDATACENTERACOR',
|
||||
'SERVERDATACENTERACORCORE',
|
||||
'SERVERDATACENTERCOR',
|
||||
'SERVERDATACENTERCORCORE',
|
||||
'SERVERDATACENTERCORE',
|
||||
'SERVERDATACENTEREVAL',
|
||||
'SERVERDATACENTEREVALCOR',
|
||||
'SERVERDATACENTEREVALCORCORE',
|
||||
'SERVERDATACENTEREVALCORE',
|
||||
'SERVERDATACENTERNANO',
|
||||
'SERVERDATACENTERNANOCORE',
|
||||
'SERVERHYPERCORE',
|
||||
'SERVERRDSH',
|
||||
'SERVERRDSHCORE',
|
||||
'SERVERSOLUTION',
|
||||
'SERVERSOLUTIONCORE',
|
||||
'SERVERSTANDARD',
|
||||
'SERVERSTANDARDACOR',
|
||||
'SERVERSTANDARDACORCORE',
|
||||
'SERVERSTANDARDCOR',
|
||||
'SERVERSTANDARDCORCORE',
|
||||
'SERVERSTANDARDCORE',
|
||||
'SERVERSTANDARDEVAL',
|
||||
'SERVERSTANDARDEVALCOR',
|
||||
'SERVERSTANDARDEVALCORCORE',
|
||||
'SERVERSTANDARDEVALCORE',
|
||||
'SERVERSTANDARDNANO',
|
||||
'SERVERSTANDARDNANOCORE',
|
||||
'SERVERSTORAGESTANDARD',
|
||||
'SERVERSTORAGESTANDARDCORE',
|
||||
'SERVERSTORAGESTANDARDEVAL',
|
||||
'SERVERSTORAGESTANDARDEVALCORE',
|
||||
'SERVERSTORAGEWORKGROUP',
|
||||
'SERVERSTORAGEWORKGROUPCORE',
|
||||
'SERVERSTORAGEWORKGROUPEVAL',
|
||||
'SERVERSTORAGEWORKGROUPEVALCORE',
|
||||
'SERVERWEB',
|
||||
'SERVERWEBCORE',
|
||||
'STARTER',
|
||||
'STARTERN',
|
||||
);
|
||||
|
||||
if($build < 17063) {
|
||||
require dirname(__FILE__).'/packs/legacy.php';
|
||||
} elseif ($build >= 17063) {
|
||||
@ -69,6 +153,7 @@ function uupGetPacks($build = 15063) {
|
||||
'editionPacks' => $editionPacks,
|
||||
'fancyEditionNames' => $fancyEditionNames,
|
||||
'fancyLangNames' => $fancyLangNames,
|
||||
'allEditions' => $allEditions,
|
||||
);
|
||||
}
|
||||
?>
|
||||
|
Loading…
Reference in New Issue
Block a user