Blame view

php/RemoteDataCenter/makeArgs.php 1.26 KB
bf74fc2d   Elena.Budnik   IMPEX
1
2
3
4
5
<?php
/*
*  Executable to make arguments lists for IMPEX 
*  Uses target.json
*/
bf74fc2d   Elena.Budnik   IMPEX
6
7
8
9
10
11
	if (!function_exists('__autoload')) {
		function __autoload($class_name) {
					require_once $class_name . '.php';
		}
	}	 
	
9c0d113f   Elena.Budnik   IMPEX final
12
13
14
15
	$AMDA_IHM = getenv('AMDA_IHM');
     
	require_once $AMDA_IHM."/php/config.php";
	
fd2b603f   Elena.Budnik   Bases.xml are in ...
16
17
18
	$BasesXml = $AMDA_IHM."/php/RemoteDataCenter/Bases.xml";
	
   if (!file_exists($BasesXml))
9c0d113f   Elena.Budnik   IMPEX final
19
20
21
22
23
24
		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");
bf74fc2d   Elena.Budnik   IMPEX
25
	
9c0d113f   Elena.Budnik   IMPEX final
26
	$basesDom = new DomDocument("1.0");
fd2b603f   Elena.Budnik   Bases.xml are in ...
27
	$basesDom->load($BasesXml);
bf74fc2d   Elena.Budnik   IMPEX
28
	
9c0d113f   Elena.Budnik   IMPEX final
29
30
31
32
33
34
35
36
37
	$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();
ed7e85cc   Elena.Budnik   is not run if ser...
38
39
40
			if ($center->monitor())
			{
				$center->makeArgumentsList();
9c0d113f   Elena.Budnik   IMPEX final
41
42
			
			//copy PlotSettings if exists		
ed7e85cc   Elena.Budnik   is not run if ser...
43
44
45
46
47
48
49
				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");
			}
9c0d113f   Elena.Budnik   IMPEX final
50
		}
28c19276   Elena.Budnik   generic template def
51
		
bf74fc2d   Elena.Budnik   IMPEX
52
53
54
   }
   
?>