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


PHP Notice::toXml方法代码示例

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


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

示例1: send

 /**
  * @param Notice $notice
  * @return string
  **/
 public function send(Notice $notice)
 {
     $curl = curl_init();
     $xml = $notice->toXml($this->configuration);
     curl_setopt($curl, CURLOPT_URL, $this->configuration->get('apiEndPoint'));
     curl_setopt($curl, CURLOPT_POST, 1);
     curl_setopt($curl, CURLOPT_HEADER, 0);
     curl_setopt($curl, CURLOPT_TIMEOUT, $this->configuration->get('timeout'));
     curl_setopt($curl, CURLOPT_POSTFIELDS, $xml);
     curl_setopt($curl, CURLOPT_HTTPHEADER, $this->headers);
     curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
     curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
     curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
     // HTTP proxy support
     $proxyHost = $this->configuration->get('proxyHost');
     $proxyUser = $this->configuration->get('proxyUser');
     if (null !== $proxyHost) {
         curl_setopt($curl, CURLOPT_PROXY, $proxyHost . ':' . $this->configuration->get('proxyPort'));
         if (null !== $proxyUser) {
             curl_setopt($curl, CURLOPT_PROXYUSERPWD, $proxyUser . ':' . $this->configuration->get('proxyPass'));
         }
     }
     $return = curl_exec($curl);
     curl_close($curl);
     return $return;
 }
开发者ID:dbtlr,项目名称:php-airbrake,代码行数:30,代码来源:Connection.php

示例2: send

 /**
  * @param Notice $notice
  * @return string
  **/
 public function send(Notice $notice)
 {
     $xml = $notice->toXml($this->configuration);
     $opts = array('http' => array('method' => 'POST', 'header' => $this->headers, 'content' => $xml));
     $context = stream_context_create($opts);
     $result = file_get_contents($this->configuration->apiEndPoint, false, $context);
     return $result;
 }
开发者ID:n-coders-dev,项目名称:php-airbrake,代码行数:12,代码来源:Connection.php

示例3: send

 /**
  * @param Airbrake\Notice $notice
  * @return string
  **/
 public function send(Notice $notice)
 {
     $curl = curl_init();
     $xml = $notice->toXml($this->configuration);
     curl_setopt($curl, CURLOPT_URL, $this->configuration->apiEndPoint);
     curl_setopt($curl, CURLOPT_POST, 1);
     curl_setopt($curl, CURLOPT_HEADER, 0);
     curl_setopt($curl, CURLOPT_TIMEOUT, $this->configuration->timeout);
     curl_setopt($curl, CURLOPT_POSTFIELDS, $xml);
     curl_setopt($curl, CURLOPT_HTTPHEADER, $this->headers);
     curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
     $return = curl_exec($curl);
     curl_close($curl);
     return $return;
 }
开发者ID:paramoredigital,项目名称:codebase-exceptions-php,代码行数:19,代码来源:Connection.php


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