示例#1
0
 public static function encode($data)
 {
     $ser = new \AMFSerializer();
     $ser->outBuffer = '';
     $ser->writeAmf3Data($data);
     return $ser->outBuffer;
 }
示例#2
0
function twistResultsFilter(&$amf)
{
    $GLOBALS['amfphp']['encoding'] = "amf3";
    $bodycount = $amf->numBody();
    for ($i = 0; $i < $bodycount; $i++) {
        $amfbody =& $amf->getBodyAt($i);
        $results = $amfbody->getResults();
        NetDebug::trace("result: " . serialize($results));
        $serializer = new AMFSerializer();
        $serializer->writeAmf3Data($results);
        $data = $serializer->outBuffer;
        $data = gzcompress($data);
        $outBa = new ByteArray($data);
        $amfbody->setResults($outBa);
        //$amfbody->setResults($data);
        //echo "<br>$results";
        return true;
    }
}