本文整理汇总了PHP中Zend_Amf_Request::initialize方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Amf_Request::initialize方法的具体用法?PHP Zend_Amf_Request::initialize怎么用?PHP Zend_Amf_Request::initialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Amf_Request
的用法示例。
在下文中一共展示了Zend_Amf_Request::initialize方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testAmf0CredentialsInHeader
/**
* Test Amf0 credentials sent to the server
*
*/
public function testAmf0CredentialsInHeader()
{
$myRequest = file_get_contents(dirname(__FILE__) . '/Request/mock/credentialsheaderAmf0.bin');
// send the mock object request to be deserialized
$this->_request->initialize($myRequest);
// Make sure that no headers where recieved
$this->assertEquals(1, sizeof($this->_request->getAmfHeaders()));
$requestHeaders = $this->_request->getAmfHeaders();
$this->assertTrue($requestHeaders[0] instanceof Zend_Amf_Value_MessageHeader);
$this->assertEquals('Credentials', $requestHeaders[0]->name);
$this->assertFalse($requestHeaders[0]->mustRead);
$data = $requestHeaders[0]->data;
// Check the resulting header
$this->assertEquals('admin', $data->userid);
$this->assertEquals('pw123', $data->password);
}
示例2: testResponseHeadersShouldBeSerializedWhenWritingMessage
public function testResponseHeadersShouldBeSerializedWhenWritingMessage()
{
$this->testResponseShouldAggregateMessageHeaders();
$this->_response->finalize();
$response = $this->_response->getResponse();
$request = new Zend_Amf_Request();
$request->initialize($response);
$headers = $request->getAmfHeaders();
$this->assertEquals(2, count($headers));
}
示例3: stdClass
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_AUTOREFERER, true);
//curl_setopt($ch, CURLOPT_VERBOSE, true);
curl_setopt($ch, CURLOPT_URL, $this->amf_gateway);
curl_setopt($ch, CURLOPT_POSTFIELDS, $this->getHttpPost());
$this->resp_data = curl_exec($ch);
curl_close($ch);
}
}
return;
//for test
/*
$data['tnd'] = 2;
$data['session_key'] = 'skvalue';
$data['pmid'] = 1111;
//*/
//*
$data = new stdClass();
$data->tnd = 2;
$data->session_key = 'skvalue';
$data->pmid = 1111;
//*/
$myreq = new AmfRequestClient('TestAmf.sendback', $data);
$myreq->doRequest();
echo "Request:\n{$myreq->post_data}\n\nResponse:\n{$myreq->resp_data}\n";
return;
$req = new Zend_Amf_Request();
$req->initialize($sreq);
var_dump($myreq);
var_dump($req);
//$myreq->doRequest();