summaryrefslogtreecommitdiffstats
path: root/check.php
diff options
context:
space:
mode:
Diffstat (limited to 'check.php')
-rwxr-xr-xcheck.php42
1 files changed, 32 insertions, 10 deletions
diff --git a/check.php b/check.php
index 5c8dc925..31f4d856 100755
--- a/check.php
+++ b/check.php
@@ -35,17 +35,18 @@ if ($cli) {
<?php
}
$repos = [
+ 'enterprise/10' => 'Enterprise Linux 10',
'enterprise/9' => 'Enterprise Linux 9',
'enterprise/8' => 'Enterprise Linux 8',
- 'enterprise/7' => 'Enterprise Linux 7',
'fedora/41' => 'Fedora 41',
'fedora/40' => 'Fedora 40',
'fedora/39' => 'Fedora 39',
];
$subs = [
+ 'modular',
'remi',
+ 'safe',
'test',
- 'php56',
];
$archs = [
'i386',
@@ -73,7 +74,6 @@ $mirrors = [
'https://mirror.netweaver.uk/remi/',
'http://ftp.riken.jp/Linux/remi/',
'https://mir01.syntis.net/remirepo/',
- 'http://mirror.hoster.kz/remi/',
'http://remirepo.reloumirrors.net/',
'https://mirror.pit.teraswitch.com/remi/',
'http://remi.mirror.liteserver.nl/',
@@ -89,8 +89,7 @@ $mirrors = [
'https://mirror.docker.ru/remi/',
'https://repo.extreme-ix.org/remi/',
'https://mirror.mangohost.net/remi/',
- 'https://cdn.fjordos.no/remi/',
- 'https://mirror.fjordos.no/remi/',
+ 'https://mirror.fjordos.com/remi/',
'https://muug.ca/mirror/remi/',
'https://mirror.netzwerge.de/remi/',
'https://pit.mirror.jurassicinnovations.com/remi/',
@@ -109,6 +108,7 @@ $testing = [
'https://mirror.usi.edu/pub/remi/', // 2024-04-03 / 2025-01-29
];
$disabled = [
+ 'http://mirror.hoster.kz/remi/',
'https://repo1.vetta.net.nz/remi/', // 2025-01-17 (too slow)
'http://mirror.xeonbd.com/remi/',
'https://mirror.telkomuniversity.ac.id/remi/',
@@ -175,10 +175,10 @@ function delta($ref, $loc) {
if ($d >= 60) {
$d /= 60;
if ($d >= 60) {
- $d /= 60;
+ $d = (int)($d / 60);
if ($d >= 24) {
- $d /= 24;
- $unit = 'day';
+ $d = (int)($d / 24);
+ $unit = 'DAY';
} else {
$unit = 'hour';
}
@@ -191,7 +191,7 @@ function delta($ref, $loc) {
if ($d > 1) {
$unit .= 's';
}
- return sprintf("%s : %2d %s ago", date('r', $loc), $d, $unit);
+ return sprintf("%s :%3d %s", date('r', $loc), $d, $unit);
}
if (isset($_GET['mirror']) && isset($repos[$_GET['mirror']])) {
@@ -209,6 +209,18 @@ if (isset($_GET['arch']) && in_array($_GET['arch'], $archs)) {
} else {
$arch = 'x86_64';
}
+if (isset($_SERVER['argv'][1]) && isset($repos[$_SERVER['argv'][1]])) {
+ $path = $_SERVER['argv'][1];
+ array_shift($_SERVER['argv']);
+}
+if (isset($_SERVER['argv'][1]) && in_array($_SERVER['argv'][1], $subs)) {
+ $repo = $_SERVER['argv'][1];
+ array_shift($_SERVER['argv']);
+}
+if (isset($_SERVER['argv'][1]) && in_array($_SERVER['argv'][1], $archs)) {
+ $arch = $_SERVER['argv'][1];
+ array_shift($_SERVER['argv']);
+}
$name = $repos[$path];
$full = "$path/$repo/$arch";
@@ -248,6 +260,16 @@ if ($ref) {
$tocheck[] = $mirror;
}
}
+ foreach ($mirrors as $testing) {
+ if (preg_match('|'.$_SERVER['argv'][1].'|', $mirror)) {
+ $tocheck[] = $mirror;
+ }
+ }
+ foreach ($mirrors as $disabled) {
+ if (preg_match('|'.$_SERVER['argv'][1].'|', $mirror)) {
+ $tocheck[] = $mirror;
+ }
+ }
if (empty($tocheck)) {
$tocheck[] = $_SERVER['argv'][1];
}
@@ -255,7 +277,7 @@ if ($ref) {
} else {
$tocheck = array_merge($mirrors, $testing);
}
- printf(($cli ? "Check %d mirror(s) of %s (%s)\n" : "<h3>%s - %s</h3>\n"), count($tocheck), $name, date('r', $ref));
+ printf(($cli ? "Check %d mirror(s) of %s (%s, %s)\n" : "<h3>%s - %s</h3>\n"), count($tocheck), $name, $full, date('r', $ref));
foreach ($tocheck as $mirror) {
if ($cli) {
$pid = pcntl_fork();