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


PHP HTTP_Request2::__construct方法代码示例

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


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

示例1: __construct

 /**
  * __construct
  *
  * @param string $server Url, including port and database name.
  *
  * @return $this
  * @uses   parent::__construct()
  */
 public function __construct($server)
 {
     $this->server = $server;
     parent::__construct($server);
     // force this for all calls
     $this->setHeader('Content-type: application/json; charset=utf-8');
 }
开发者ID:jeremykendall,项目名称:spaz-api,代码行数:15,代码来源:ArmChair.php

示例2: __construct

 public function __construct($url)
 {
     parent::__construct($url);
     $this->setConfig('follow_redirects', true);
     $this->setConfig('connect_timeout', 5);
     $this->setConfig('timeout', 10);
     $this->setConfig('ssl_verify_peer', false);
     $this->setHeader('user-agent', 'phinde/bot');
 }
开发者ID:cweiske,项目名称:phinde,代码行数:9,代码来源:HttpRequest.php

示例3: __construct

 /**
  * Defaults to CliAdapter, and enables the 'index_file' setting.
  * 
  * @param string $url
  * @param int $method
  * @param array $config 
  */
 public function __construct($url = null, $method = self::METHOD_GET, array $config = array())
 {
     if (empty($config['adapter'])) {
         $config['adapter'] = new CliAdapter();
     }
     $this->config['index_file'] = '';
     $this->checkConfig($config);
     parent::__construct($url, $method, $config);
 }
开发者ID:runekaagaard,项目名称:php-cli-http,代码行数:16,代码来源:CliRequest.php

示例4:

 function IMDB_Request($url)
 {
     parent::__construct($url);
     if (PROXY != "") {
         $this->setConfig(array('proxy_host' => PROXY, 'proxy_port' => PROXY_PORT));
     }
     $this->setConfig('follow_redirects', false);
     $this->setHeader("User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)");
 }
开发者ID:chenrizhi,项目名称:mtpt,代码行数:9,代码来源:imdb_config.php

示例5: __construct

 public function __construct($url, $method = AbstractClient::METHOD_GET, $config = array())
 {
     if (isset($config['dataType'])) {
         $this->_dataType = $config['dataType'];
         unset($config['dataType']);
     }
     $config['ssl_verify_peer'] = false;
     $config['ssl_verify_host'] = false;
     parent::__construct($url, $method, $config);
 }
开发者ID:mobilerider,项目名称:mobilerider-client-php,代码行数:10,代码来源:Request.php

示例6: array

 function __construct($url = null, $method = self::METHOD_GET, array $config = array())
 {
     if (extension_loaded('curl') && strpos(@ini_get('disable_functions'), 'curl_exec') === false) {
         $this->setConfig('adapter', 'HTTP_Request2_Adapter_Curl');
     }
     $this->setConfig('proxy_host', Am_Di::getInstance()->config->get('http.proxy_host'));
     $this->setConfig('proxy_port', Am_Di::getInstance()->config->get('http.proxy_port'));
     $this->setConfig('proxy_user', Am_Di::getInstance()->config->get('http.proxy_user'));
     $this->setConfig('proxy_password', Am_Di::getInstance()->config->get('http.proxy_password'));
     $this->setConfig('ssl_verify_peer', Am_Di::getInstance()->config->get('http.verify_peer', false));
     $this->setConfig('ssl_verify_host', Am_Di::getInstance()->config->get('http.verify_host', false));
     $this->setConfig('ssl_cafile', Am_Di::getInstance()->config->get('http.ssl_cafile', null));
     $this->setConfig('ssl_cafile', Am_Di::getInstance()->config->get('http.ssl_cafile', null));
     parent::__construct($url, $method, $config);
 }
开发者ID:alexanderTsig,项目名称:arabic,代码行数:15,代码来源:HttpRequest.php

示例7:

 function IMDB_Request($url)
 {
     parent::__construct($url);
     if (PROXY != "") {
         $this->setConfig(array('proxy_host' => PROXY, 'proxy_port' => PROXY_PORT));
     }
     $this->setConfig('follow_redirects', false);
     $this->setHeader('Host', '72.21.211.32');
     $this->setHeader('User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8');
     $this->setHeader('Accept', 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8');
     $this->setHeader('Accept-Language', 'en-us,en;q=0.5');
     $this->setHeader('Accept-Encoding', 'deflate');
     $this->setHeader('Accept-Charset', 'ISO-8859-1,utf-8;q=0.7,*;q=0.7');
     $this->setHeader('Content-Type', 'application/x-www-form-urlencoded');
     $this->setHeader('Referer', '72.21.211.32');
 }
开发者ID:CptTZ,项目名称:NexusPHP-1,代码行数:16,代码来源:imdb_config.php

示例8: array

 function __construct($url = null, $method = self::METHOD_GET, $config = array())
 {
     $this->config['max_redirs'] = 10;
     $this->config['follow_redirects'] = true;
     // We've had some issues with keepalive breaking with
     // HEAD requests, such as to youtube which seems to be
     // emitting chunked encoding info for an empty body
     // instead of not emitting anything. This may be a
     // bug on YouTube's end, but the upstream libray
     // ought to be investigated to see if we can handle
     // it gracefully in that case as well.
     $this->config['protocol_version'] = '1.0';
     // Default state of OpenSSL seems to have no trusted
     // SSL certificate authorities, which breaks hostname
     // verification and means we have a hard time communicating
     // with other sites' HTTPS interfaces.
     //
     // Turn off verification unless we've configured a CA bundle.
     if (common_config('http', 'ssl_cafile')) {
         $this->config['ssl_cafile'] = common_config('http', 'ssl_cafile');
     } else {
         $this->config['ssl_verify_peer'] = false;
     }
     if (common_config('http', 'curl') && extension_loaded('curl')) {
         $this->config['adapter'] = 'HTTP_Request2_Adapter_Curl';
     }
     parent::__construct($url, $method, $config);
     $this->setHeader('User-Agent', $this->userAgent());
 }
开发者ID:stevertiqo,项目名称:StatusNet,代码行数:29,代码来源:httpclient.php

示例9: __construct

 /**
  * Default constructor - sets TYPO3 defaults
  *
  * @param string|\Net_Url2 $url Request URL
  * @param string $method Request Method (GET, HEAD or POST). Redirects reset this to GET unless "strict_redirects" is set.
  * @param array $config Configuration for this request instance
  * @link http://pear.php.net/manual/en/package.http.http-request2.config.php
  */
 public function __construct($url = NULL, $method = self::METHOD_GET, array $config = array())
 {
     parent::__construct($url, $method);
     $this->setConfiguration($config);
 }
开发者ID:khanhdeux,项目名称:typo3test,代码行数:13,代码来源:HttpRequest.php

示例10: array

 function __construct($url = null, $method = self::METHOD_GET, $config = array())
 {
     $this->config['max_redirs'] = 10;
     $this->config['follow_redirects'] = true;
     // We've had some issues with keepalive breaking with
     // HEAD requests, such as to youtube which seems to be
     // emitting chunked encoding info for an empty body
     // instead of not emitting anything. This may be a
     // bug on YouTube's end, but the upstream libray
     // ought to be investigated to see if we can handle
     // it gracefully in that case as well.
     $this->config['protocol_version'] = '1.0';
     parent::__construct($url, $method, $config);
     $this->setHeader('User-Agent', $this->userAgent());
 }
开发者ID:sukhjindersingh,项目名称:PHInest-Solutions,代码行数:15,代码来源:httpclient.php


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