makeArgs.php
1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
/*
* Executable to make arguments lists for IMPEX
* Uses target.json
*/
if (!function_exists('__autoload')) {
function __autoload($class_name) {
require_once $class_name . '.php';
}
}
$AMDA_IHM = getenv('AMDA_IHM');
require_once $AMDA_IHM."/php/config.php";
$BasesXml = $AMDA_IHM."/php/RemoteDataCenter/Bases.xml";
if (!file_exists($BasesXml))
exit('No Bases.xml file'.PHP_EOL);
if (!defined('SimuTargetsXml'))
exit('SimuTargetsXml is not defined in config.php'.PHP_EOL);
// $simuBases = array("LATMOS", "FMI_HYBRID", "FMI_GUMICS", "LESIA");
$basesDom = new DomDocument("1.0");
$basesDom->load($BasesXml);
$bases = $basesDom->getElementsByTagName("dataCenter");
foreach ($bases as $base)
{
if ($base->hasAttribute('isSimulation'))
{
$class = $base->getAttribute('xml:id');
echo PHP_EOL.$class.PHP_EOL;
$center = new $class();
if ($center->monitor())
{
$center->makeArgumentsList();
//copy PlotSettings if exists
if (file_exists(DATAPATH."SimuTemplate/".$center->plotSettings))
copy(DATAPATH."SimuTemplate/".$center->plotSettings, RemoteData.$center->baseID.'/'.$center->plotSettings);
}
else
{
print_r("Attention : $class service is down");
}
}
}
?>