$v) { $getvar = get("$key"); if (!in_array($getvar, $v)) { $out = "Error $key: $getvar - not in list - " . implode(", ", $v); return $out; } } } $source = $debug = false; $release = get('release'); $arch = get('arch'); $section = get('section'); $repo = get('repo'); $debug = get('debug'); $source = get('source'); $arraycheck =array( 'release' => array('5', '6', '7', 'cauldron'), 'arch' => array('i586', 'x86_64', 'SRPMS', 'armv5tl', 'armv7hl', 'aarch64'), 'section' => array('core', 'nonfree', 'tainted'), 'repo' => array('release', 'updates', 'updates_testing', 'backports', 'backports_testing'), ); if ($source){ $link = "MIRROR/distrib/$release/SRPMS/$section/$repo/"; }elseif ($debug){ $link = "MIRROR/distrib/$release/$arch/media/debug/$section/$repo/"; }else{ $link = "MIRROR/distrib/$release/$arch/media/$section/$repo/"; } if ($release && $arch && $section && $repo){ $out = check($arraycheck); if (empty($out)){ $wsd = new Downloads(); $dl = $wsd->prepare_download(true, null, true, false, true); foreach ($dl['mirrors_list'] as $one_mirror) { $out .= str_replace('MIRROR', $one_mirror, $link) . "\n"; } } }else{ $out = "Invalid options"; } header('Content-Type: text/plain'); echo "$out\n";