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


PHP Hybrid_Logger::debug方法代码示例

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


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

示例1: request

 private function request($url, $params = false, $type = "GET")
 {
     Hybrid_Logger::info("Enter OAuth2Client::request( {$url} )");
     Hybrid_Logger::debug("OAuth2Client::request(). dump request params: ", serialize($params));
     if ($type == "GET") {
         $url = $url . (strpos($url, '?') ? '&' : '?') . http_build_query($params, '', '&');
     }
     $this->http_info = array();
     $ch = curl_init();
     curl_setopt($ch, CURLOPT_URL, $url);
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
     curl_setopt($ch, CURLOPT_TIMEOUT, $this->api->curl_time_out);
     curl_setopt($ch, CURLOPT_USERAGENT, $this->api->curl_useragent);
     curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $this->api->curl_connect_time_out);
     curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, $this->api->curl_ssl_verifypeer);
     curl_setopt($ch, CURLOPT_HTTPHEADER, $this->api->curl_header);
     if ($this->api->curl_proxy) {
         curl_setopt($ch, CURLOPT_PROXY, $this->api->curl_proxy);
     }
     if ($type == "POST") {
         curl_setopt($ch, CURLOPT_POST, 1);
         if ($params) {
             curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
         }
     }
     $response = curl_exec($ch);
     Hybrid_Logger::debug("OAuth2Client::request(). dump request info: ", serialize(curl_getinfo($ch)));
     Hybrid_Logger::debug("OAuth2Client::request(). dump request result: ", serialize($response));
     $this->http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
     $this->http_info = array_merge($this->http_info, curl_getinfo($ch));
     curl_close($ch);
     return $response;
 }
开发者ID:leloulight,项目名称:epetitions,代码行数:33,代码来源:Odnoklassniki.php

示例2: authenticate

 private function authenticate($code)
 {
     $params = array("client_id" => $this->api->client_id, "client_secret" => $this->api->client_secret, "grant_type" => "authorization_code", "redirect_uri" => $this->api->redirect_uri, "code" => $code);
     $url = $this->api->token_url;
     $url = $url . (strpos($url, '?') ? '&' : '?') . http_build_query($params);
     $response = $this->api->api($url, 'POST');
     Hybrid_Logger::debug("authenticate with url: {$url}");
     if (!$response || !isset($response->access_token)) {
         throw new Exception("The Authorization Service has return: " . $response->error);
     }
     if (isset($response->access_token)) {
         $this->api->access_token = $response->access_token;
     }
     if (isset($response->refresh_token)) {
         $this->api->refresh_token = $response->refresh_token;
     }
     if (isset($response->expires_in)) {
         $this->api->access_token_expires_in = $response->expires_in;
     }
     // calculate when the access token expire
     if (isset($response->expires_in)) {
         $this->api->access_token_expires_at = time() + $response->expires_in;
     }
     return $response;
 }
开发者ID:hybridauth,项目名称:hybridauth,代码行数:25,代码来源:Weibo.php

示例3: loginFinish

 /**
  * finish login step 
  */
 function loginFinish()
 {
     // in case we get error_reason=user_denied&error=access_denied
     if (isset($_REQUEST['error']) && $_REQUEST['error'] == "access_denied") {
         Hybrid_Logger::debug("QQ access_denied");
         throw new Exception("Authentification failed! The user denied your request.", 5);
     }
     if (!isset($_REQUEST['code']) || !isset($_REQUEST['state'])) {
         Hybrid_Logger::debug("QQ no code or state");
         throw new Exception("Authentification failed! The user denied your request.", 5);
     }
     $code = $_REQUEST['code'];
     $state = $_REQUEST['state'];
     // try to get the UID of the connected user from fb, should be > 0
     try {
         $access_token = $this->api->qq_callback();
         $openid = $this->api->get_openid();
         Hybrid_Logger::debug("Get QQ openid: {$openid}");
     } catch (Exception $e) {
         Hybrid_Logger::error("Authentification failed for {$this->providerId} ");
         Hybrid_Logger::error("Exception:" . $e->getMessage(), $e);
     }
     if (!$access_token || !$openid) {
         throw new Exception("Authentification failed! {$this->providerId} returned invalide access token or openid", 5);
     }
     // set user as logged in
     $this->setUserConnected();
     // store access token
     //$this->token( "access_token", $this->api->getAccessToken() );
 }
开发者ID:pingwangcs,项目名称:51zhaohu,代码行数:33,代码来源:QQ.php

示例4: __construct

 public function __construct($inc)
 {
     Hybrid_Logger::debug("Construct QQ Recorder");
     $this->error = new ErrorCase();
     //-------读取配置文件
     //$incFileContents = file(ROOT."comm/inc.php");
     //$incFileContents = $incFileContents[1];
     //$this->inc = json_decode($incFileContents);
     $this->inc = $inc;
     if (empty($this->inc)) {
         $this->error->showError("20001");
     }
     if (empty($_SESSION['QC_userData'])) {
         self::$data = array();
     } else {
         self::$data = $_SESSION['QC_userData'];
     }
 }
开发者ID:pingwangcs,项目名称:51zhaohu,代码行数:18,代码来源:Recorder.class.php

示例5: __construct

 /**
  * common providers adapter constructor
  */
 function __construct($providerId, $config, $params = NULL)
 {
     # init the IDp adapter parameters, get them from the cache if possible
     if (!$params) {
         $this->params = Hybrid_Auth::storage()->get("hauth_session.{$providerId}.id_provider_params");
     } else {
         $this->params = $params;
     }
     // idp id
     $this->providerId = $providerId;
     // set HybridAuth endpoint for this provider
     $this->endpoint = Hybrid_Auth::storage()->get("hauth_session.{$providerId}.hauth_endpoint");
     // idp config
     $this->config = $config;
     // new user instance
     $this->user = new Hybrid_User();
     $this->user->providerId = $providerId;
     // initialize the current provider adapter
     $this->initialize();
     Hybrid_Logger::debug("Hybrid_Provider_Model::__construct( {$providerId} ) initialized. dump current adapter instance: ", serialize($this));
 }
开发者ID:Lavoaster,项目名称:PVLive,代码行数:24,代码来源:Provider_Model.php

示例6: setup

 /**
  * Setup an adapter for a given provider
  */
 public static function setup($providerId, $params = NULL)
 {
     Hybrid_Logger::debug("Enter Hybrid_Auth::setup( {$providerId} )", $params);
     if (!$params) {
         $params = Hybrid_Auth::storage()->get("hauth_session.{$providerId}.id_provider_params");
         Hybrid_Logger::debug("Hybrid_Auth::setup( {$providerId} ), no params given. Trying to get the sotred for this provider.", $params);
     }
     if (!$params) {
         $params = array();
         Hybrid_Logger::info("Hybrid_Auth::setup( {$providerId} ), no stored params found for this provider. Initialize a new one for new session");
     }
     if (!isset($params["hauth_return_to"])) {
         $params["hauth_return_to"] = Hybrid_Auth::getCurrentUrl();
     }
     Hybrid_Logger::debug("Hybrid_Auth::setup( {$providerId} ). HybridAuth Callback URL set to: ", $params["hauth_return_to"]);
     # instantiate a new IDProvider Adapter
     $provider = new Hybrid_Provider_Adapter();
     $provider->factory($providerId, $params);
     return $provider;
 }
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:23,代码来源:Auth.php

示例7: login

 /**
  * Hybrid_Provider_Adapter::login(), prepare the user session and the authentification request
  * for index.php
  */
 function login()
 {
     Hybrid_Logger::info("Enter Hybrid_Provider_Adapter::login( {$this->id} ) ");
     if (!$this->adapter) {
         throw new Exception("Hybrid_Provider_Adapter::login() should not directly used.");
     }
     // clear all unneeded params
     foreach (Hybrid_Auth::$config["providers"] as $idpid => $params) {
         Hybrid_Auth::storage()->delete("hauth_session.{$idpid}.hauth_return_to");
         Hybrid_Auth::storage()->delete("hauth_session.{$idpid}.hauth_endpoint");
         Hybrid_Auth::storage()->delete("hauth_session.{$idpid}.id_provider_params");
     }
     // make a fresh start
     $this->logout();
     # get hybridauth base url
     $HYBRID_AUTH_URL_BASE = Hybrid_Auth::$config["base_url"];
     # we make use of session_id() as storage hash to identify the current user
     # using session_regenerate_id() will be a problem, but ..
     $this->params["hauth_token"] = session_id();
     # set request timestamp
     $this->params["hauth_time"] = time();
     # for default HybridAuth endpoint url hauth_login_start_url
     # 	auth.start  required  the IDp ID
     # 	auth.time   optional  login request timestamp
     $this->params["login_start"] = $HYBRID_AUTH_URL_BASE . (strpos($HYBRID_AUTH_URL_BASE, '?') ? '&' : '?') . "hauth.start={$this->id}&hauth.time={$this->params["hauth_time"]}";
     # for default HybridAuth endpoint url hauth_login_done_url
     # 	auth.done   required  the IDp ID
     $this->params["login_done"] = $HYBRID_AUTH_URL_BASE . (strpos($HYBRID_AUTH_URL_BASE, '?') ? '&' : '?') . "hauth.done={$this->id}";
     Hybrid_Auth::storage()->set("hauth_session.{$this->id}.hauth_return_to", $this->params["hauth_return_to"]);
     Hybrid_Auth::storage()->set("hauth_session.{$this->id}.hauth_endpoint", $this->params["login_done"]);
     Hybrid_Auth::storage()->set("hauth_session.{$this->id}.id_provider_params", $this->params);
     // store config to be used by the end point
     $_SESSION["HA::CONFIG"] = serialize(Hybrid_Auth::$config);
     // move on
     Hybrid_Logger::debug("Hybrid_Provider_Adapter::login( {$this->id} ), redirect the user to login_start URL.", $this->params);
     Hybrid_Auth::redirect($this->params["login_start"]);
 }
开发者ID:elainenaomi,项目名称:labxp2014,代码行数:41,代码来源:Provider_Adapter.php

示例8: login

 /**
  * Hybrid_Provider_Adapter::login(), prepare the user session and the authentication request
  * for index.php
  * @return void
  * @throw Exception
  */
 function login()
 {
     Hybrid_Logger::info("Enter Hybrid_Provider_Adapter::login( {$this->id} ) ");
     if (!$this->adapter) {
         throw new Exception("Hybrid_Provider_Adapter::login() should not directly used.");
     }
     // clear all unneeded params
     foreach (Hybrid_Auth::$config["providers"] as $idpid => $params) {
         Hybrid_Auth::storage()->delete("hauth_session.{$idpid}.hauth_return_to");
         Hybrid_Auth::storage()->delete("hauth_session.{$idpid}.hauth_endpoint");
         Hybrid_Auth::storage()->delete("hauth_session.{$idpid}.id_provider_params");
     }
     // make a fresh start
     $this->logout();
     # get hybridauth base url
     if (empty(Hybrid_Auth::$config["base_url"])) {
         // the base url wasn't provide, so we must use the current
         // url (which makes sense actually)
         $url = empty($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == 'off' ? 'http' : 'https';
         $url .= '://' . $_SERVER['HTTP_HOST'];
         $url .= $_SERVER['REQUEST_URI'];
         $HYBRID_AUTH_URL_BASE = $url;
     } else {
         $HYBRID_AUTH_URL_BASE = Hybrid_Auth::$config["base_url"];
     }
     // make sure params is array
     if (!is_array($this->params)) {
         $this->params = array();
     }
     # we make use of session_id() as storage hash to identify the current user
     # using session_regenerate_id() will be a problem, but ..
     $this->params["hauth_token"] = session_id();
     # set request timestamp
     $this->params["hauth_time"] = time();
     # for default HybridAuth endpoint url hauth_login_start_url
     # 	auth.start  required  the IDp ID
     # 	auth.time   optional  login request timestamp
     $this->params["login_start"] = $HYBRID_AUTH_URL_BASE . (strpos($HYBRID_AUTH_URL_BASE, '?') ? '&' : '?') . "hauth.start={$this->id}&hauth.time={$this->params["hauth_time"]}";
     # for default HybridAuth endpoint url hauth_login_done_url
     # 	auth.done   required  the IDp ID
     $this->params["login_done"] = $HYBRID_AUTH_URL_BASE . (strpos($HYBRID_AUTH_URL_BASE, '?') ? '&' : '?') . "hauth.done={$this->id}";
     if (isset($this->params["hauth_return_to"])) {
         Hybrid_Auth::storage()->set("hauth_session.{$this->id}.hauth_return_to", $this->params["hauth_return_to"]);
     }
     if (isset($this->params["login_done"])) {
         Hybrid_Auth::storage()->set("hauth_session.{$this->id}.hauth_endpoint", $this->params["login_done"]);
     }
     Hybrid_Auth::storage()->set("hauth_session.{$this->id}.id_provider_params", $this->params);
     // store config to be used by the end point
     Hybrid_Auth::storage()->config("CONFIG", Hybrid_Auth::$config);
     // move on
     Hybrid_Logger::debug("Hybrid_Provider_Adapter::login( {$this->id} ), redirect the user to login_start URL.");
     Hybrid_Auth::redirect($this->params["login_start"]);
 }
开发者ID:KevinStoneCode,项目名称:twmap,代码行数:60,代码来源:Provider_Adapter.php

示例9: request

 /** 
  * Make http request  
  */
 function request($url, $method, $postfields = NULL, $auth_header = NULL, $content_type = NULL)
 {
     Hybrid_Logger::info("Enter OAuth1Client::request( {$method}, {$url} )");
     Hybrid_Logger::debug("OAuth1Client::request(). dump post fields: ", serialize($postfields));
     $this->http_info = array();
     $ci = curl_init();
     /* Curl settings */
     curl_setopt($ci, CURLOPT_USERAGENT, $this->curl_useragent);
     curl_setopt($ci, CURLOPT_CONNECTTIMEOUT, $this->curl_connect_time_out);
     curl_setopt($ci, CURLOPT_TIMEOUT, $this->curl_time_out);
     curl_setopt($ci, CURLOPT_RETURNTRANSFER, TRUE);
     curl_setopt($ci, CURLOPT_HTTPHEADER, array('Expect:'));
     curl_setopt($ci, CURLOPT_SSL_VERIFYPEER, $this->curl_ssl_verifypeer);
     curl_setopt($ci, CURLOPT_HEADERFUNCTION, array($this, 'getHeader'));
     curl_setopt($ci, CURLOPT_HEADER, FALSE);
     if ($content_type) {
         curl_setopt($ci, CURLOPT_HTTPHEADER, array('Expect:', "Content-Type: {$content_type}"));
     }
     if ($this->curl_proxy) {
         curl_setopt($ci, CURLOPT_PROXY, $this->curl_proxy);
     }
     switch ($method) {
         case 'POST':
             curl_setopt($ci, CURLOPT_POST, TRUE);
             if (!empty($postfields)) {
                 curl_setopt($ci, CURLOPT_POSTFIELDS, $postfields);
             }
             if (!empty($auth_header) && $this->curl_auth_header) {
                 curl_setopt($ci, CURLOPT_HTTPHEADER, array('Content-Type: application/atom+xml', $auth_header));
             }
             break;
         case 'DELETE':
             curl_setopt($ci, CURLOPT_CUSTOMREQUEST, 'DELETE');
             if (!empty($postfields)) {
                 $url = "{$url}?{$postfields}";
             }
     }
     curl_setopt($ci, CURLOPT_URL, $url);
     $response = curl_exec($ci);
     if ($response === FALSE) {
         Hybrid_Logger::error("OAuth1Client::request(). curl_exec error: ", curl_error($ci));
     }
     Hybrid_Logger::debug("OAuth1Client::request(). dump request info: ", serialize(curl_getinfo($ci)));
     Hybrid_Logger::debug("OAuth1Client::request(). dump request result: ", serialize($response));
     $this->http_code = curl_getinfo($ci, CURLINFO_HTTP_CODE);
     $this->http_info = array_merge($this->http_info, curl_getinfo($ci));
     curl_close($ci);
     return $response;
 }
开发者ID:bladehr8,项目名称:bowhunter2015,代码行数:52,代码来源:OAuth1Client.php

示例10: destroySession

 public function destroySession()
 {
     Hybrid_Logger::debug("Enter QC.class destroySession");
     $this->recorder->destroySession();
     //     	$cookie_name = "openapi.qzone.qq.com";
     //     	if (array_key_exists($cookie_name, $_COOKIE)) {
     //     		Hybrid_Logger::debug( "Enter QC.class delete cookie" );
     //     		setcookie($cookie_name, "", time() - 1);
     //     	}
     print_r($_COOKIE);
     if (isset($_COOKIE)) {
         $cookies = explode(';', $_COOKIE);
         foreach ($cookies as $cookie) {
             $parts = explode('=', $cookie);
             $name = trim($parts[0]);
             Hybrid_Logger::debug("http_cookie {$name}");
             //setcookie($name, '', time()-1000);
             //setcookie($name, '', time()-1000, '/');
         }
     }
     //     	$qzone_cookie = array('RK', 'pgv_pvi', 'pgv_si', 'pt2gguin','ptcz');
     //     	if (!empty($_COOKIE))
     //     	{
     //     		foreach ($_COOKIE as $name => $value)
     //     		{
     //     			if (in_array($name, $qzone_cookie))
     //     			{
     //     				Hybrid_Logger::debug( "destroy qzone_cookie {$name}" );
     //     				setcookie($name, $value, time() -1);
     //     			}
     //     		}
     //     	}
 }
开发者ID:pingwangcs,项目名称:51zhaohu,代码行数:33,代码来源:QC.class.php

示例11: request

 private function request($url, $params = false, $type = "GET")
 {
     $params = http_build_query($params, '', '&');
     Hybrid_Logger::info("Enter OAuth2Client::request( {$url} )");
     Hybrid_Logger::debug("OAuth2Client::request(). dump request params: ", $params);
     if ($type == "GET") {
         $url = $url . (strpos($url, '?') ? '&' : '?') . $params;
     }
     $this->http_info = array();
     $ch = curl_init();
     $headers = $this->curl_header;
     if ($type == "POST") {
         //$headers[] = 'Content-Type: application/x-www-form-urlencoded';
     }
     curl_setopt($ch, CURLOPT_URL, $url);
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
     curl_setopt($ch, CURLOPT_TIMEOUT, $this->curl_time_out);
     curl_setopt($ch, CURLOPT_USERAGENT, $this->curl_useragent);
     curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $this->curl_connect_time_out);
     curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, $this->curl_ssl_verifypeer);
     curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, $this->curl_ssl_verifyhost);
     curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
     curl_setopt($ch, CURLOPT_USERPWD, $this->client_id . ':' . $this->client_secret);
     // logging
     if ($this->curl_log !== null) {
         $fp = fopen($this->curl_log, 'a');
         curl_setopt($ch, CURLOPT_STDERR, $fp);
         curl_setopt($ch, CURLOPT_VERBOSE, 1);
     }
     if ($this->curl_proxy) {
         curl_setopt($ch, CURLOPT_PROXY, $this->curl_proxy);
     }
     if ($type == "POST") {
         curl_setopt($ch, CURLOPT_POST, 1);
         curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
     }
     $response = curl_exec($ch);
     if ($this->curl_log !== null) {
         fclose($fp);
     }
     if ($response === FALSE) {
         Hybrid_Logger::error("OAuth2Client::request(). curl_exec error: ", curl_error($ch));
     }
     Hybrid_Logger::debug("OAuth2Client::request(). dump request info: ", serialize(curl_getinfo($ch)));
     Hybrid_Logger::debug("OAuth2Client::request(). dump request result: ", serialize($response));
     $this->http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
     $this->http_info = array_merge($this->http_info, curl_getinfo($ch));
     curl_close($ch);
     return $response;
 }
开发者ID:DonaldNgai,项目名称:PHPAuthentication,代码行数:50,代码来源:PaypalOAuth2Client.php

示例12: request

 private function request($url, $params = false, $type = "GET")
 {
     Hybrid_Logger::info("Enter OAuth2Client::request( {$url} )");
     Hybrid_Logger::debug("OAuth2Client::request(). dump request params: ", serialize($params));
     if ($type == "GET") {
         $url = $url . "?" . http_build_query($params);
     }
     $ch = curl_init();
     curl_setopt($ch, CURLOPT_URL, $url);
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
     curl_setopt($ch, CURLOPT_TIMEOUT, $this->curl_time_out);
     curl_setopt($ch, CURLOPT_USERAGENT, $this->curl_useragent);
     curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $this->curl_connect_time_out);
     curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, $this->curl_ssl_verifypeer);
     curl_setopt($ch, CURLOPT_HTTPHEADER, $this->curl_header);
     if ($type == "POST") {
         curl_setopt($ch, CURLOPT_POST, 1);
         if ($params) {
             curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
         }
     }
     $result = curl_exec($ch);
     $info = curl_getinfo($ch);
     curl_close($ch);
     Hybrid_Logger::debug("OAuth2Client::request(). dump request info: ", serialize($info));
     Hybrid_Logger::debug("OAuth2Client::request(). dump request result: ", serialize($result));
     return $result;
 }
开发者ID:elainenaomi,项目名称:labxp2014,代码行数:28,代码来源:OAuth2Client.php

示例13: request

 private function request($url, $params = false, $type = "GET")
 {
     Hybrid_Logger::info("Enter OAuth2Client::request( {$url} )");
     Hybrid_Logger::debug("OAuth2Client::request(). dump request params: ", serialize($params));
     if ($type == "GET") {
         $url = $url . (strpos($url, '?') ? '&' : '?') . http_build_query($params);
     }
     $this->http_info = array();
     $ch = curl_init();
     curl_setopt($ch, CURLOPT_URL, $url);
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
     curl_setopt($ch, CURLOPT_TIMEOUT, $this->curl_time_out);
     curl_setopt($ch, CURLOPT_USERAGENT, $this->curl_useragent);
     curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $this->curl_connect_time_out);
     $config = Yii::app()->getModule('hybridauth')->getConfig();
     if ($config['proxy']) {
         curl_setopt($ch, CURLOPT_PROXYTYPE, 'HTTPS');
         curl_setopt($ch, CURLOPT_PROXY, $config['proxy']['url']);
         curl_setopt($ch, CURLOPT_PROXYPORT, $config['proxy']['port']);
         if ($config['proxy']['user']) {
             curl_setopt($ch, CURLOPT_PROXYUSERPWD, $config['proxy']['user'] . ':' . $config['proxy']['password']);
         }
         //curl_setopt($ch, CURLOPT_PROXYAUTH, CURLAUTH_NTLM);
     }
     curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, $this->curl_ssl_verifypeer);
     curl_setopt($ch, CURLOPT_HTTPHEADER, $this->curl_header);
     if ($type == "POST") {
         curl_setopt($ch, CURLOPT_POST, 1);
         if ($params) {
             curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
         }
     }
     $response = curl_exec($ch);
     Hybrid_Logger::debug("OAuth2Client::request(). dump request info: ", serialize(curl_getinfo($ch)));
     Hybrid_Logger::debug("OAuth2Client::request(). dump request result: ", serialize($response));
     $this->http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
     $this->http_info = array_merge($this->http_info, curl_getinfo($ch));
     curl_close($ch);
     return $response;
 }
开发者ID:righ22,项目名称:Xata,代码行数:40,代码来源:OAuth2Client.php

示例14: request

 /** 
  * Make http request  
  */
 function request($url, $method, $postfields = NULL, $auth_header = null)
 {
     Hybrid_Logger::info("Enter OAuth1Client::request( {$method}, {$url} )");
     Hybrid_Logger::debug("OAuth1Client::request(). dump post fields: ", serialize($postfields));
     $this->http_info = array();
     $ci = curl_init();
     /* Curl settings */
     curl_setopt($ci, CURLOPT_USERAGENT, $this->curl_useragent);
     curl_setopt($ci, CURLOPT_CONNECTTIMEOUT, $this->curl_connect_time_out);
     $config = Yii::app()->getModule('hybridauth')->getConfig();
     if ($config['proxy']) {
         curl_setopt($ch, CURLOPT_PROXYTYPE, 'HTTPS');
         curl_setopt($ch, CURLOPT_PROXY, $config['proxy']['url']);
         curl_setopt($ch, CURLOPT_PROXYPORT, $config['proxy']['port']);
         if ($config['proxy']['user']) {
             curl_setopt($ch, CURLOPT_PROXYUSERPWD, $config['proxy']['user'] . ':' . $config['proxy']['password']);
         }
         //curl_setopt($ch, CURLOPT_PROXYAUTH, CURLAUTH_NTLM);
     }
     curl_setopt($ci, CURLOPT_TIMEOUT, $this->curl_time_out);
     curl_setopt($ci, CURLOPT_RETURNTRANSFER, TRUE);
     curl_setopt($ci, CURLOPT_HTTPHEADER, array('Expect:'));
     curl_setopt($ci, CURLOPT_SSL_VERIFYPEER, $this->curl_ssl_verifypeer);
     curl_setopt($ci, CURLOPT_HEADERFUNCTION, array($this, 'getHeader'));
     curl_setopt($ci, CURLOPT_HEADER, FALSE);
     switch ($method) {
         case 'POST':
             curl_setopt($ci, CURLOPT_POST, TRUE);
             if (!empty($postfields)) {
                 curl_setopt($ci, CURLOPT_POSTFIELDS, $postfields);
             }
             if (!empty($auth_header) && $this->curl_auth_header) {
                 curl_setopt($ci, CURLOPT_HTTPHEADER, array('Content-Type: application/atom+xml', $auth_header));
             }
             break;
         case 'DELETE':
             curl_setopt($ci, CURLOPT_CUSTOMREQUEST, 'DELETE');
             if (!empty($postfields)) {
                 $url = "{$url}?{$postfields}";
             }
     }
     curl_setopt($ci, CURLOPT_URL, $url);
     $response = curl_exec($ci);
     Hybrid_Logger::debug("OAuth1Client::request(). dump request info: ", serialize(curl_getinfo($ci)));
     Hybrid_Logger::debug("OAuth1Client::request(). dump request result: ", serialize($response));
     $this->http_code = curl_getinfo($ci, CURLINFO_HTTP_CODE);
     $this->http_info = array_merge($this->http_info, curl_getinfo($ci));
     curl_close($ci);
     return $response;
 }
开发者ID:righ22,项目名称:Xata,代码行数:53,代码来源:OAuth1Client.php

示例15: fetchUnitDetails

 /**
  * Call OU->UnitDetail
  *
  * @ignore
  * @param \SoapClient $ouClient Nastavený SoapClient
  * @param int $unitId
  * @param string $idLogin
  * @return \HybridAuth\SkautIS\Unit
  */
 protected function fetchUnitDetails(\SoapClient $ouClient, $unitId, $idLogin)
 {
     if (isset($this->unitDataCache[$unitId])) {
         if (!$this->unitDataCache[$unitId]) {
             return null;
         }
         return $this->unitDataCache[$unitId];
     }
     try {
         $unitDetailResult = $ouClient->UnitDetail(array("unitDetailInput" => array("ID_Login" => $idLogin, "ID" => $unitId)));
         \Hybrid_Logger::debug("Called SkautIS's OU->UnitDetail", $unitDetailResult);
     } catch (\Exception $e) {
         $this->unitDataCache[$unitId] = false;
         return null;
     }
     if ($unitDetailResult) {
         $unitObject = new Unit($unitDetailResult->UnitDetailResult);
         $this->unitDataCache[$unitId] = $unitObject;
         return $unitObject;
     }
     $this->unitDataCache[$unitId] = false;
     return null;
 }
开发者ID:ondrakoupil,项目名称:hybridauth-skautis,代码行数:32,代码来源:Adapter.php


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