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


PHP Curl::setopt_array方法代码示例

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


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

示例1: testCurlWrapperCanDoHttpQueries

 function testCurlWrapperCanDoHttpQueries()
 {
     $curl = new Curl(self::TEST_VALID_URL);
     $curl->setopt(CURLOPT_PROXY, $this->proxy);
     $this->assertTrue($curl->setopt(CURLOPT_RETURNTRANSFER, 1));
     $this->assertTrue($curl->setopt_array(array(CURLOPT_TIMEOUT => self::CURL_TIMEOUT, CURLOPT_FOLLOWLOCATION => true)));
     $result = $curl->exec();
     $this->assertStringStartsWith('<!doctype html>', $result);
     $curl->close();
     $this->assertFalse($curl->hasHandle());
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:11,代码来源:CurlTest.php

示例2: getComments

 /**
  *
  * Return case's comments; I assume that there wouldn't be single requests for events of more than 1 case
  * (comments should be show when user clicks on proper button
  * Important: Function is not ready and not used yet.
  * that might be corrected/developed in future
  * 
  * THIS NO WORK !!!
  * THIS NO WORK !!!
  * 
  * @param int $caseID
  */
 public function getComments($caseID)
 {
     $res = 'No comments for this case.';
     $this->resetParams();
     $this->setParam('cmd', 'search');
     $this->setParam('token', $this->token);
     $this->setParam('q', $caseID);
     $this->setParam('cols', 'events');
     $this->curl->setopt_array($this->getCurlOptions());
     $xml = $this->curl->exec();
     if (!empty($xml)) {
         $dom = new DOMDocument();
         $dom->loadXML($xml);
         //$case = $dom->getElementsByTagName( 'case' );
         $events = $dom->getElementsByTagName('event');
         //->item(0)->nodeValue;
         unset($res);
         $res = array();
         foreach ($events as $event) {
             $res[] = array('ixPerson' => $event->getElementsByTagName('ixPerson')->item(0)->nodeValue, 'sPerson' => $event->getElementsByTagName('sPerson')->item(0)->nodeValue, 'ixPersonAssignedTo' => $event->getElementsByTagName('ixPersonAssignedTo')->item(0)->nodeValue, 'dt' => $event->getElementsByTagName('dt')->item(0)->nodeValue, 'evtDescription' => $event->getElementsByTagName('evtDescription')->item(0)->nodeValue, 'sChanges' => $event->getElementsByTagName('sChanges')->item(0)->nodeValue);
         }
     }
     return $res;
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:36,代码来源:FogbugzService.class.php


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