Blame view

update_amda/mvTemplates.php 1.26 KB
4c77b9b1   Elena.Budnik   final update
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
<?php

     $NEWMETA = getenv('NEWMETA');
     $AMDAINSTALLATION = getenv('AMDAINSTALLATION');
     $AMDAINTERNALDIR = getenv('AMDAINTERNALDIR');
     
     $templateXml = new DomDocument("1.0");
     $templateXml->load($AMDAINTERNALDIR."/ParamTemplateList.xml");
     $paramTemplates =  $templateXml->getElementsByTagName('paramTemplate');
     
     if (!is_dir("$AMDAINSTALLATION/AMDA_IHM/generic_data/ParamTemplate")) 
		mkdir("$AMDAINSTALLATION/AMDA_IHM/generic_data/ParamTemplate");
     
     foreach ($paramTemplates as $template) {    
       $paramId = $template->getAttribute('paramId');
       $fileName = $template->getAttribute('fileName');
       // for spase-list params
       if (file_exists("$NEWMETA/final/$paramId.xml")) {
		echo "Template  ".$paramId.PHP_EOL;
		$from = "$NEWMETA/final/$paramId.xml";
		$to = "$AMDAINSTALLATION/AMDA_IHM/generic_data/ParamTemplate/$fileName.xml";	
		
	  	copy($from, $to);
		unlink("$NEWMETA/final/$paramId.xml");
	}
	//  for internal params
	if (file_exists("$AMDAINTERNALDIR/INTERNAL_PARAM_DEF/$paramId.xml")) {
		echo "Template  ".$paramId.PHP_EOL;
		$from = "$AMDAINTERNALDIR/INTERNAL_PARAM_DEF/$paramId.xml";
		$to = "$AMDAINSTALLATION/AMDA_IHM/generic_data/ParamTemplate/$fileName.xml";	
	  	copy($from,$to);					
	}
     }     
?>