setResults($error); if($GLOBALS['amfphp']['encoding'] == 'amf0' || $GLOBALS['amfphp']['encoding'] == 'amf3') { // build a new AMFObject $amfout = new AMFObject(""); $amfout->addBody($amfbody); // Add the trace headers we have so far while we're at it debugFilter($amfout); // create a new serializer $serializer = new AMFSerializer(); // serialize the data $data = $serializer->serialize($amfout); // send the correct header header('Content-type: application/x-amf'); // flush the amf data to the client. print($data); // kill the system after we find a single error exit; } else { serializationAction($amfbody); print($amfbody->getResults()); exit; } } set_error_handler("reportExceptions"); ?>