public function __construct()
 {
     include "RAM.php";
     $serverInfo = getInfoClass();
     $this->cpu = $serverInfo->getCPU();
     $this->ip = $_SERVER['SERVER_ADDR'];
     $this->os = $serverInfo->getOS();
     $this->kernel = $serverInfo->getKernel();
     $this->CPUArchitecture = $serverInfo->getCPUArchitecture();
     $this->proccess = $serverInfo->getProcessStats();
 }
Exemple #2
0
function testClase($fileName,$propValue,$propValue2,$smarty,$colClass,$Class) {
	
	global $g_pathGenClassXML;
	
	//------------------------------------------------------------------------
	//---Roundtrip para no usar funciones XML incopatibles entre PHP4 y PHP5
	//------------------------------------------------------------------------
	//Leo la definicion XML de la Entidades	
	$fo= fopen("./modules/_codegen/$g_pathGenClassXML/".$fileName,"r") or die ("No se encuentra la pagina.");
	while (!feof($fo)) {
		$sXML .= fgets($fo, 4096);
	}
	fclose ($fo);
	
	//paso el xml a un array
	$xml = xmlize($sXML);
	//print_r($xml);


	$auxProps = $xml['xml']['#']['properties'][0]['#']['property'];
	
	for($i = 0; $i < count($auxProps); $i++) {
		$property = $auxProps[$i];	
		
		$_Propiedades[$i]['NOMBRE'] = $property['#']['nombre'][0]['#'];
		$_Propiedades[$i]['CAMPO'] = strtoupper($property['#']['campo'][0]['#']);
		$_Propiedades[$i]['TIPO'] = strtoupper($property['#']['tipo'][0]['#']);
		$_Propiedades[$i]['NULO'] = strtoupper($property['#']['nulo'][0]['#']);
		$_Propiedades[$i]['KEY'] = strtoupper($property['#']['key'][0]['#']);		
		$_Propiedades[$i]['VALUE'] = $propValue[$i] ;		
	}

	//Instancio Class Collection
	eval('$_colClass = new '.$colClass.'();');
	//Instancio Class
	eval('$_Class = new '.$Class.'();');
	
	
	//Seteo Propiedades for insert	
	for($i = 0; $i < count($auxProps); $i++) {
		if(strlen($_Propiedades[$i]['VALUE'])>0){
			if($_Propiedades[$i]['TIPO']=='NUMBER'){
				eval('$_Class->'.$_Propiedades[$i]['NOMBRE'].'='.$_Propiedades[$i]['VALUE'].';');
			}else{
				eval('$_Class->'.$_Propiedades[$i]['NOMBRE']."='".$_Propiedades[$i]['VALUE']."';");
			}
		}
	}
	
	// --- Test Insert Method ------
	$rc = $_Class->Persistir();
	$id = intval($rc->_array[0][0]);

	$_Class->getByID($id);
	$smarty->assign('clsINS',getInfoClass($_Class));

	// --- Test Update Method ------

	//Seteo Propiedades for update
	
	for($i = 0; $i < count($auxProps); $i++) {
		if(strlen($propValue2[$i])>0){
			if($_Propiedades[$i]['TIPO']=='NUMBER'){
				eval('$_Class->'.$_Propiedades[$i]['NOMBRE'].'='.$propValue2[$i].';');
			}else{
				eval('$_Class->'.$_Propiedades[$i]['NOMBRE']."='".$propValue2[$i]."';");
			}
		}
	}

	$rc = $_Class->Persistir();
	$id = intval($rc->_array[0][0]);

	$_Class->getByID($id);
	$smarty->assign('clsUPD',getInfoClass($_Class));


// --- Test GetALL Method ------
	$rs = $_colClass->GetAll();

	$rsAll = simplifyArray($rs->_array );
	$smarty->assign('rsAll',$rsAll);

// --- Test Delete Method ------
	$_Class->getByID($id);
	$_Class->Eliminar();
	$smarty->assign('id',$id);


// --- Test GetALL Method ------
	$rs = $_colClass->GetAll();

	$rsAll = simplifyArray($rs->_array );
	$smarty->assign('rsAll2',$rsAll);
}