本文整理汇总了PHP中Zend_XmlRpc_Response::__toString方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_XmlRpc_Response::__toString方法的具体用法?PHP Zend_XmlRpc_Response::__toString怎么用?PHP Zend_XmlRpc_Response::__toString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_XmlRpc_Response
的用法示例。
在下文中一共展示了Zend_XmlRpc_Response::__toString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __toString
/**
* Override __toString() to send HTTP Content-Type header
*
* @return string
*/
public function __toString()
{
if (!headers_sent()) {
header('Content-Type: application/xml; charset=utf-8');
}
return parent::__toString();
}
示例2: __toString
/**
* Override __toString() to send HTTP Content-Type header
*
* @return string
*/
public function __toString()
{
if (!headers_sent()) {
header('Content-Type: text/xml; charset=' . strtolower($this->getEncoding()));
}
return parent::__toString();
}
示例3: test__toString
/**
* __toString() test
*
* Call as method call
*
* Returns: string
*/
public function test__toString()
{
$this->_response->setReturnValue('return value');
$xml = $this->_response->__toString();
try {
$sx = new SimpleXMLElement($xml);
} catch (Exception $e) {
$this->fail('Invalid XML returned');
}
$this->assertTrue($sx->params ? true : false);
$this->assertTrue($sx->params->param ? true : false);
$this->assertTrue($sx->params->param->value ? true : false);
$this->assertTrue($sx->params->param->value->string ? true : false);
$this->assertEquals('return value', (string) $sx->params->param->value->string);
}
示例4: test__toString
/**
* __toString() test
*/
public function test__toString()
{
$this->_response->setReturnValue('return value');
$xml = $this->_response->__toString();
$this->_testXmlResponse($xml);
}
示例5: getServerResponseFor
public function getServerResponseFor($nativeVars)
{
$response = new Zend_XmlRpc_Response();
$response->setReturnValue($nativeVars);
$xml = $response->__toString();
$response = $this->makeHttpResponseFrom($xml);
return $response;
}