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


PHP HttpRequest::__construct方法代码示例

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


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

示例1: __construct

 public function __construct($curlHandle, $path, $accept, array $params = NULL)
 {
     parent::__construct($curlHandle, $path, $accept, $params);
     $this->httpMethod = "HEAD";
     curl_setopt($curlHandle, CURLOPT_CUSTOMREQUEST, $this->httpMethod);
     curl_setopt($curlHandle, CURLOPT_NOBODY, TRUE);
 }
开发者ID:fredrickabayie,项目名称:MyBankWeb,代码行数:7,代码来源:HttpHead.php

示例2: __construct

 /**
  * Constructor
  *
  * @param ObjectConfig|null $config  An optional ObjectConfig object with configuration options
  * @return HttpResponse
  */
 public function __construct(ObjectConfig $config)
 {
     parent::__construct($config);
     //Set query parameters
     $this->setQuery($config->query);
     //Set data parameters
     $this->setData($config->data);
 }
开发者ID:janssit,项目名称:nickys.janss.be,代码行数:14,代码来源:request.php

示例3: __construct

 /**
  * Constructor
  *
  * @param ObjectConfig|null $config  An optional ObjectConfig object with configuration options
  */
 public function __construct(ObjectConfig $config)
 {
     parent::__construct($config);
     // Set the user identifier
     $this->_user = $config->user;
     //Set query parameters
     $this->setQuery($config->query);
     //Set data parameters
     $this->setData($config->data);
     //Set the format
     $this->setFormat($config->format);
 }
开发者ID:nooku,项目名称:nooku-framework,代码行数:17,代码来源:request.php

示例4:

 function __construct($app_id, $app_key, $app_secret)
 {
     //put the FB API keys here:
     $this->fb_id = $app_id;
     $this->fb_key = $app_key;
     $this->fb_secret = $app_secret;
     //call parent constructor
     parent::__construct();
     //set up the specifics for connecting to facebook's api
     $this->request_params['port'] = 443;
     $this->request_params['scheme'] = 'tls://';
     $this->request_params['host'] = $this->fb_d;
 }
开发者ID:adaburrows,项目名称:FB-Graph-API,代码行数:13,代码来源:fb.php

示例5: __construct

 public function __construct($curlHandle, $path, $accept, array $params = NULL)
 {
     parent::__construct($curlHandle, $path, $accept, NULL);
     $this->httpMethod = "DELETE";
     $this->contentType = parent::URLENCODED;
     $this->path = $path;
     $this->curlHandle = $curlHandle;
     $this->accept = $accept;
     // set the http method
     curl_setopt($curlHandle, CURLOPT_CUSTOMREQUEST, $this->httpMethod);
     if ($params != NULL) {
         $this->body = http_build_query($params);
         curl_setopt($curlHandle, CURLOPT_POSTFIELDS, $this->body);
     }
 }
开发者ID:fredrickabayie,项目名称:MyBankWeb,代码行数:15,代码来源:HttpDelete.php

示例6: __construct

 public function __construct($url, $requestMethod = HTTP_METH_GET, array $options = array())
 {
     static $proxyOptions = array(), $hasProxyOptions = false;
     // Proxy settings from site.ini
     if (!$hasProxyOptions) {
         $ini = eZINI::instance();
         $proxyServer = $ini->hasVariable('ProxySettings', 'ProxyServer') ? $ini->variable('ProxySettings', 'ProxyServer') : false;
         if ($proxyServer) {
             $proxyServerParts = parse_url($proxyServer);
             $proxyOptions['proxyhost'] = $proxyServerParts['host'];
             $proxyOptions['proxyport'] = $proxyServerParts['port'];
             $proxyOptions['proxytype'] = HTTP_PROXY_HTTP;
             $proxyUsername = $ini->hasVariable('ProxySettings', 'User') ? $ini->variable('ProxySettings', 'User') : false;
             $proxyPassword = $ini->hasVariable('ProxySettings', 'Password') ? $ini->variable('ProxySettings', 'Password') : false;
             if ($proxyUsername) {
                 $proxyOptions['proxyauth'] = "{$proxyUsername}:{$proxyPassword}";
             }
         }
         $hasProxyOptions = true;
     }
     parent::__construct($url, $requestMethod, $options + $proxyOptions);
 }
开发者ID:ezsystems,项目名称:ezphttprequest,代码行数:22,代码来源:ezphttprequest.php

示例7: __construct

 /**
  * コンストラクタ
  *
  * @param string $url
  * @param string $destination
  * @param array $options
  * @param P2HttpCallback $onSuccess
  * @param P2HttpCallback $onFailure
  */
 public function __construct($url, $destination, array $options = null, P2HttpCallback $onSuccess = null, P2HttpCallback $onFailure = null)
 {
     global $_conf;
     if ($options === null) {
         $options = array();
     }
     if (!isset($options['connecttimeout'])) {
         $options['connecttimeout'] = $_conf['fsockopen_time_limit'];
     }
     if (!isset($options['timeout'])) {
         $options['timeout'] = $_conf['fsockopen_time_limit'] * 2;
     }
     if (!isset($options['compress'])) {
         $options['compress'] = true;
     }
     if (!isset($options['useragent'])) {
         $options['useragent'] = P2Util::getP2UA($withMonazilla = true);
     }
     if ($_conf['proxy_use'] && !isset($options['proxyhost']) && !empty($_conf['proxy_host'])) {
         $options['proxyhost'] = $_conf['proxy_host'];
         if (!empty($_conf['proxy_port']) && is_numeric($_conf['proxy_port'])) {
             $options['proxyport'] = (int) $_conf['proxy_port'];
         } elseif (strpos($_conf['proxy_host'], ':') === false) {
             $options['proxyport'] = 80;
         }
         /*
         $options['proxytype'] = HTTP_PROXY_HTTP;
         if (isset($_conf['proxy_type'])) {
             switch ($_conf['proxy_type']) {
             case 'http':   $options['proxytype'] = HTTP_PROXY_HTTP;   break;
             case 'socks4': $options['proxytype'] = HTTP_PROXY_SOCKS4; break;
             case 'socks5': $options['proxytype'] = HTTP_PROXY_SOCKS5; break;
             default:
                 if (is_numeric($options['proxytype'])) {
                     $options['proxytype'] = (int)$_conf['proxy_type'];
                 }
             }
         }
         
         if (!empty($_conf['proxy_auth'])) {
             $options['proxy_auth'] = $_conf['proxy_auth'];
             $options['proxyauthtype'] = HTTP_AUTH_BASIC;
             if (isset($_conf['proxy_auth_type'])) {
                 switch ($_conf['proxy_auth_type']) {
                 case 'basic':  $options['proxyauthtype'] = HTTP_AUTH_BASIC;  break;
                 case 'digest': $options['proxyauthtype'] = HTTP_AUTH_DIGEST; break;
                 case 'ntlm':   $options['proxyauthtype'] = HTTP_AUTH_NTLM;   break;
                 case 'gssneg': $options['proxyauthtype'] = HTTP_AUTH_GSSNEG; break;
                 case 'any':    $options['proxyauthtype'] = HTTP_AUTH_ANY;    break;
                 default:
                     if (is_numeric($options['proxytype'])) {
                         $options['proxyauthtype'] = (int)$_conf['proxy_auth_type'];
                     }
                 }
             }
         }
         */
     }
     if (!isset($options['lastmodified']) && file_exists($destination)) {
         $options['lastmodified'] = filemtime($destination);
     } else {
         FileCtl::mkdir_for($destination);
     }
     $this->_destination = $destination;
     $this->_permission = !empty($_conf['dl_perm']) ? $_conf['dl_perm'] : 0666;
     $this->_errorCode = self::E_NONE;
     $this->_errorInfo = '';
     $this->_onSuccess = $onSuccess;
     $this->_onFailure = $onFailure;
     $this->_next = null;
     parent::__construct($url, HttpRequest::METH_GET, $options);
 }
开发者ID:poppen,项目名称:p2,代码行数:81,代码来源:P2HttpExt.php


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