aboutsummaryrefslogtreecommitdiffstats
path: root/tools/update-mirrors-list.php
blob: ee17f9b2c629c0a4ddd939ae4b1fd4696c1a64ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php
/**
 * Run this to update lib/cached.list.php mirrors list from mirrors.mageia.org/api
 *
 * Usage for regeneration of cached.list.php for ISO and torrent files:
 * php ./tools/update-mirrors-list.php
 *
 * Usage for regeneration of cached.list_doc.php for documentation files:
 * php ./tools/update-mirrors-list.php true
 *
*/

require __DIR__ . '/../lib/Downloads.php';
$documentation = isset($argv[1]) ? $argv[1] : false;

if($documentation) {
    echo 'Rebuilding' . __DIR__ . '/cached.list_doc.php with date.txt as a test file.' . PHP_EOL;
} else {
    echo 'Rebuilding' . __DIR__ . '/cached.list.php with one torrent as a test file.' . PHP_EOL;
}
Downloads::get_all_mirrors(false, $documentation);