当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_XmlRpc_Request::saveXml方法代码示例

本文整理汇总了PHP中Zend_XmlRpc_Request::saveXml方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_XmlRpc_Request::saveXml方法的具体用法?PHP Zend_XmlRpc_Request::saveXml怎么用?PHP Zend_XmlRpc_Request::saveXml使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_XmlRpc_Request的用法示例。


在下文中一共展示了Zend_XmlRpc_Request::saveXml方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: serialize

 /**
  * {@inheritdoc}
  */
 public function serialize($method, array $params = [])
 {
     $toBeVisited = [&$params];
     while (isset($toBeVisited[0]) && ($value =& $toBeVisited[0])) {
         $type = gettype($value);
         if ($type === 'array') {
             // Zend converts non-zero-indexed arrays to structs
             if (array_keys($value) !== range(0, count($value) - 1) && array_keys($value) == range(1, count($value))) {
                 $value = array_values($value);
             }
             foreach ($value as &$child) {
                 $toBeVisited[] =& $child;
             }
         } elseif ($type === 'object') {
             if ($value instanceof \DateTime) {
                 $value = \Zend_XmlRpc_Value::getXmlRpcValue($value->format('Ymd\\TH:i:s'), \Zend_XmlRpc_Value::XMLRPC_TYPE_DATETIME);
             } elseif ($value instanceof Base64) {
                 $value = \Zend_XmlRpc_Value::getXmlRpcValue($value->getDecoded(), \Zend_XmlRpc_Value::XMLRPC_TYPE_BASE64);
             } else {
                 $value = get_object_vars($value);
             }
         } elseif ($type === 'resource') {
             throw new InvalidTypeException($value);
         }
         array_shift($toBeVisited);
     }
     $request = new \Zend_XmlRpc_Request($method, $params);
     try {
         return $request->saveXml();
     } catch (\Exception $e) {
         throw new SerializerException($e->getMessage(), $e->getCode(), $e);
     }
 }
开发者ID:fxmlrpc,项目名称:serialization,代码行数:36,代码来源:Zend1Serializer.php

示例2: testSaveXML

 /**
  * testSaveXML() test
  */
 public function testSaveXML()
 {
     $argv = array('string', true);
     $this->_request->setMethod('do.Something');
     $this->_request->setParams($argv);
     $xml = $this->_request->saveXml();
     $this->_testXmlRequest($xml, $argv);
 }
开发者ID:navassouza,项目名称:zf2,代码行数:11,代码来源:RequestTest.php

示例3: microtime

$serializer = null;
$start = microtime(true);
for ($a = 0; $a < $limit; ++$a) {
    $request = new Zend\XmlRpc\Request();
    $request->setMethod('test');
    $request->setParams($args);
    $r = $request->saveXml();
}
$end = microtime(true);
printf("Zend\\XmlRpc\\Request (ZF2): %s sec for %d passes\n", $end - $start, $limit);
$start = microtime(true);
for ($a = 0; $a < $limit; ++$a) {
    $request = new Zend_XmlRpc_Request();
    $request->setMethod('test');
    $request->setParams($args);
    $r = $request->saveXml();
}
$end = microtime(true);
printf("Zend_XmlRpc_Request (ZF1): %s sec for %d passes\n", $end - $start, $limit);
$start = microtime(true);
for ($a = 0; $a < $limit; ++$a) {
    $serializer = new fXmlRpc\Serializer\XmlWriterSerializer();
    $r = $serializer->serialize('test', $args);
}
$end = microtime(true);
printf("fXmlRpc\\Serializer\\XmlWriterSerializer: %s sec for %d passes\n", $end - $start, $limit);
$start = microtime(true);
for ($a = 0; $a < $limit; ++$a) {
    $serializer = new fXmlRpc\Serializer\NativeSerializer();
    $r = $serializer->serialize('test', $args);
}
开发者ID:Banjerr,项目名称:infusionWholesaler,代码行数:31,代码来源:serializer.php


注:本文中的Zend_XmlRpc_Request::saveXml方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。