makeArgs.php 1.14 KB
<?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";
	
   if (! file_exists(DATAPATH."/RemoteData/Bases.xml"))
		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(DATAPATH."/RemoteData/Bases.xml");
	
	$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();
		
			$center->makeArgumentsList();
			
			//copy PlotSettings if exists		
			if (file_exists(DATAPATH."SimuTemplate/".$center->plotSettings))
				copy(DATAPATH."SimuTemplate/".$center->plotSettings, RemoteData.$center->baseID.'/'.$center->plotSettings);
		}
		
   }
   
?>