oSystem=&$oSystem; } function gsGetRequest($sURL,$asData=false,$sUser=false,$sPass=false) { if($pCurl=@curl_init($sURL)) { curl_setopt($pCurl,CURLOPT_RETURNTRANSFER,2); if($sUser!==false && $sPass!==false) { // curl_setopt($pCurl,CURLOPT_USERPWD,"usrPosition:gatewayUser"); curl_setopt($pCurl,CURLOPT_USERPWD,$sUser.":".$sPass); } $checkSum=false; if($asData!==false) { $sData=base64_encode(gzcompress(wddx_serialize_value($asData))); $checkSum=crc32($sData); curl_setopt($pCurl,CURLOPT_POSTFIELDS,$sData); } if($sReturn=curl_exec($pCurl)) { if($wddxData=@gzuncompress(@base64_decode($sReturn))) { $as=wddx_deserialize($wddxData); if($checkSum!==false) { if($as["crc32"]==$checkSum) { return $as; } } else return $as; } return false; } else { return false; } } } } class CWDDXResult { function CWDDXResult($asData) { $this->mlIndex=false; $this->masResultRecords=$asData["records"]; $this->mlRowsAffected=$asData["affectedrows"]; $this->mlCountRows=sizeof($asData["records"]); $this->mlFields=sizeof($asData["records"][0]); $this->mlInsertID=$asData["lastinsertid"]; } function glGetAffectedRows() { return $this->mlRowsAffected; } function glGetNumberOfRecords() { return $this->mlCountRows; } function goGetFieldInfo($lOffset) { return false; } function goGetRecord($bFree=false) { $asData=@array_shift($this->masResultRecords); $oObject=new CArrayToObject($asData); if($p!==false) return $p; return false; } function gasGetRecord($bFree=true) { $p=@array_shift($this->masResultRecords); if($p!==false) return $p; return false; } function gaaGetAllRecords($bReturnFalse=false,$bFree=true) { return $this->masResultRecords; } function glGetInsertID() { return $this->mlInsertID; } function gasAssociativeOnly($asData) { // $asReturn=array(); if(is_array($asData)) { foreach($asData as $sKey=>$sValue) if(!is_int($sKey)) $asReturn[$sKey]=$sValue; } return $asReturn; } function gaoGetAllRecords($bReturnFalse=false,$bFree=false) { $aoReturn=array(); // passing bFree to gasGetRecord frees the resultset while($oPush=$this->goGetRecord(false)) { array_push($aoReturn,$oPush); } if($bReturnFalse===true && sizeof($asReturn)==0) return false; return $aoReturn; } } class CArrayToObject { function CArrayToObject($asData) { foreach($asData as $sKey=>$sValue) { $check=(integer)$sKey; if($check==0) { $this->$sKey=$sValue; } } } }