1 |
<?php |
2 |
/** |
3 |
* Run fetch/digest/publish scripts for Mageia.org logs. |
4 |
*/ |
5 |
|
6 |
/** */ |
7 |
date_default_timezone_set('Europe/Paris'); |
8 |
|
9 |
$params = array( |
10 |
'Downloads' => array('downloads', 'rda', 'www.mageia.org'), |
11 |
'Releases' => array('releases', 'rda', 'releases.mageia.org') |
12 |
); |
13 |
|
14 |
$dt0 = new DateTime(); |
15 |
|
16 |
// all data extraction/migration scripts should be there |
17 |
require '../lib/Mageia/Data/Cron.php'; |
18 |
foreach (glob('../lib/Mageia/Data/Cron/*.php') as $class) |
19 |
require $class; |
20 |
|
21 |
$classes = array_filter(get_declared_classes(), function ($e) { |
22 |
return preg_match('/Mageia_Data_Cron_(.*)/', $e); |
23 |
}); |
24 |
|
25 |
foreach ($params as $k => $p) { |
26 |
$c = 'Mageia_Data_Cron_' . $k; |
27 |
$cl = new $c($p, strtotime('-1 day'), __DIR__, 'tmplogs'); |
28 |
$cl->run(); |
29 |
} |
30 |
|
31 |
$dt1 = new DateTime(); |
32 |
$dt = $dt0->diff($dt1); |
33 |
echo "It took ", $dt->format("%R%Hh %Imin %Ss"), "\n"; |
34 |
|
35 |
|
36 |
|