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


PHP CHTTP::sGetHeader方法代码示例

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


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

示例1: GetCurrentUser

 public function GetCurrentUser()
 {
     if ($this->access_token === false) {
         return false;
     }
     $result = CHTTP::sGetHeader(static::CONTACTS_URL . '?access_token=' . urlencode($this->access_token), array(), $this->httpTimeout);
     if (!defined("BX_UTF")) {
         $result = CharsetConverter::ConvertCharset($result, "utf-8", LANG_CHARSET);
     }
     $result = CUtil::JsObjectToPhp($result);
     if (is_array($result)) {
         $result["access_token"] = $this->access_token;
         $result["refresh_token"] = $this->refresh_token;
         $result["expires_in"] = $this->accessTokenExpires;
     }
     return $result;
 }
开发者ID:rasuldev,项目名称:torino,代码行数:17,代码来源:google.php

示例2: GetCurrentUser

 public function GetCurrentUser()
 {
     if ($this->access_token === false) {
         return false;
     }
     $result = CHTTP::sGetHeader(self::GRAPH_URL . '/me?access_token=' . $this->access_token . "&fields=picture,id,name,first_name,last_name,gender,birthday,email", array(), $this->httpTimeout);
     if (!defined("BX_UTF")) {
         $result = CharsetConverter::ConvertCharset($result, "utf-8", LANG_CHARSET);
     }
     return CUtil::JsObjectToPhp($result);
 }
开发者ID:spas-viktor,项目名称:books,代码行数:11,代码来源:facebook.php

示例3: GetCurrentUser

	public function GetCurrentUser()
	{
		if($this->access_token === false)
			return false;

		$result = CHTTP::sGetHeader(self::USERINFO_URL.'?format=json&oauth_token='.urlencode($this->access_token), array(), $this->httpTimeout);

		if(!defined("FX_UTF"))
			$result = CharsetConverter::ConvertCharset($result, "utf-8", LANG_CHARSET);

		$result = CUtil::JsObjectToPhp($result);

		if(is_array($result))
		{
			$result["access_token"] = $this->access_token;
			$result["refresh_token"] = $this->refresh_token;
			$result["expires_in"] = $this->accessTokenExpires;
		}
		return $result;
	}
开发者ID:ASDAFF,项目名称:open_bx,代码行数:20,代码来源:yandex.php

示例4: SendFeed

 public function SendFeed($socServUserId, $message, $getNewToken = true)
 {
     if (!$this->access_token || intval($this->userId) < 1) {
         self::SetOauthKeys($socServUserId);
     }
     if (!defined("BX_UTF")) {
         $message = CharsetConverter::ConvertCharset($message, LANG_CHARSET, "utf-8");
     }
     $this->sign = strtolower(md5('application_key=' . $this->appKey . 'method=users.setStatusstatus=' . $message . md5($this->access_token . $this->appSecret)));
     $result = CHTTP::sGetHeader(self::CONTACTS_URL . "?method=users.setStatus&application_key=" . $this->appKey . "&access_token=" . $this->access_token . "&sig=" . $this->sign . "&status=" . urlencode($message), array(), $this->httpTimeout);
     if (!defined("BX_UTF")) {
         $result = CharsetConverter::ConvertCharset($result, "utf-8", LANG_CHARSET);
     }
     $arResult = CUtil::JsObjectToPhp($result);
     if ($getNewToken === true && isset($arResult["error_code"]) && $arResult["error_code"] == "102") {
         $newToken = self::RefreshToken($socServUserId);
         if ($newToken === true) {
             self::SendFeed($socServUserId, $message, false);
         } else {
             return false;
         }
     }
     return $arResult;
 }
开发者ID:Satariall,项目名称:izurit,代码行数:24,代码来源:odnoklassniki.php

示例5: GetCurrentUser

	public function GetCurrentUser()
	{
		if($this->access_token === false)
			return false;

		$result = CHTTP::sGetHeader(self::CONTACTS_URL.'?uids='.$this->userID.'&fields=uid,first_name,last_name,nickname,screen_name,sex,bdate,city,country,timezone,photo,photo_medium,photo_big,photo_rec&access_token='.urlencode($this->access_token), array(), $this->httpTimeout);

		if(!defined("BX_UTF"))
			$result = CharsetConverter::ConvertCharset($result, "utf-8", LANG_CHARSET);

		return CUtil::JsObjectToPhp($result);
	}
开发者ID:ASDAFF,项目名称:bxApiDocs,代码行数:12,代码来源:vkontakte.php

示例6: GetCurrentUserFriends

	public function GetCurrentUserFriends($limit = 0, $offset = 0)
	{
		if($this->access_token === false)
			return false;

		$url = self::FRIENDS_URL."?access_token=".urlencode($this->access_token);

		if($limit > 0)
		{
			$url .= '&limit='.intval($limit)."&offset=".intval($offset);
		}

		$result = CHTTP::sGetHeader($url, array(), $this->httpTimeout);
		if(!defined("BX_UTF"))
			$result = CharsetConverter::ConvertCharset($result, "utf-8", LANG_CHARSET);

		$result = CUtil::JsObjectToPhp($result);

		if(is_array($result))
		{
			$result["access_token"] = $this->access_token;
			$result["refresh_token"] = $this->refresh_token;
			$result["expires_in"] = $this->accessTokenExpires;
		}
		return $result;
	}
开发者ID:ASDAFF,项目名称:entask.ru,代码行数:26,代码来源:liveidoauth.php

示例7: GetCurrentUser

 public function GetCurrentUser()
 {
     if ($this->access_token === false) {
         return false;
     }
     $sign = md5("app_id=" . $this->appID . "method=users.getInfosecure=1session_key=" . $this->access_token . $this->appSecret);
     $result = CHTTP::sGetHeader(self::CONTACTS_URL . '?method=users.getInfo&secure=1&app_id=' . $this->appID . '&session_key=' . urlencode($this->access_token) . '&sig=' . $sign, array(), $this->httpTimeout);
     if (!defined("BX_UTF")) {
         $result = CharsetConverter::ConvertCharset($result, "utf-8", LANG_CHARSET);
     }
     return CUtil::JsObjectToPhp($result);
 }
开发者ID:andy-profi,项目名称:bxApiDocs,代码行数:12,代码来源:mailru.php

示例8: GetCurrentUserFriends

 public function GetCurrentUserFriends($limit, &$next)
 {
     if ($this->access_token === false) {
         return false;
     }
     $url = self::FRIENDS_URL . '?uids=' . $this->userID . '&fields=uid,first_name,last_name,nickname,screen_name,photo_200_orig,contacts,email&access_token=' . urlencode($this->access_token);
     if ($limit > 0) {
         $url .= "&count=" . intval($limit) . "&offset=" . intval($next);
     }
     $result = CHTTP::sGetHeader($url, array(), $this->httpTimeout);
     if (!defined("BX_UTF")) {
         $result = CharsetConverter::ConvertCharset($result, "utf-8", LANG_CHARSET);
     }
     $result = CUtil::JsObjectToPhp($result);
     $next = $limit + $next;
     return $result;
 }
开发者ID:rasuldev,项目名称:torino,代码行数:17,代码来源:vkontakte.php

示例9: GetAllPages

 private function GetAllPages($arResult)
 {
     static $arTwits = array();
     if (!isset($arResult["search_metadata"]["next_results"])) {
         return $arTwits;
     }
     parse_str(preg_replace("|\\?|", '', $arResult["search_metadata"]["next_results"]), $searchMetaData);
     $arParams = array_merge(array("count" => $searchMetaData["count"], "include_entities" => $searchMetaData["include_entities"], "max_id" => $searchMetaData["max_id"]), $this->GetDefParams());
     $arParams = array_merge($arParams, array("oauth_token" => $this->token, "q" => $searchMetaData["q"]));
     $arParams["oauth_signature"] = urlencode($this->BuildSignature($this->GetSignatureString($arParams, self::SEARCH_URL)));
     $arHeaders = array("Authorization" => 'OAuth oauth_consumer_key="' . $arParams["oauth_consumer_key"] . '", oauth_nonce="' . $arParams["oauth_nonce"] . '", oauth_signature="' . $arParams["oauth_signature"] . '", oauth_signature_method="HMAC-SHA1", oauth_timestamp="' . $arParams["oauth_timestamp"] . '", oauth_token="' . $this->token . '", oauth_version="1.0"', "Content-type" => "application/x-www-form-urlencoded");
     $result = CHTTP::sGetHeader(self::SEARCH_URL . "?count=" . $searchMetaData["count"] . "&include_entities=" . $searchMetaData["include_entities"] . "&max_id=" . $searchMetaData["max_id"] . "&q=" . urlencode($searchMetaData["q"]), $arHeaders, $this->httpTimeout);
     if (!defined("BX_UTF")) {
         $result = CharsetConverter::ConvertCharset($result, "utf-8", LANG_CHARSET);
     }
     $arResult = CUtil::JsObjectToPhp($result);
     if (is_array($arResult["statuses"])) {
         $arTwits = array_merge($arTwits, $arResult["statuses"]);
     }
     return self::GetAllPages($arResult);
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:21,代码来源:twitter.php

示例10: GetCurrentUser

 public function GetCurrentUser()
 {
     if ($this->access_token === false) {
         return false;
     }
     $result = CHTTP::sGetHeader(self::CONTACTS_URL . "?access_token=" . urlencode($this->access_token), array(), $this->httpTimeout);
     if (!defined("BX_UTF")) {
         $result = CharsetConverter::ConvertCharset($result, "utf-8", LANG_CHARSET);
     }
     return CUtil::JsObjectToPhp($result);
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:11,代码来源:liveidoauth.php

示例11: getPlannerTasksId

	public function getPlannerTasksId()
	{
		$arHeaders = array();
		$result = CHTTP::sGetHeader($this->portalURI.'/rest/task.planner.getlist?auth='.$this->access_token, $arHeaders, $this->httpTimeout);

		return $this->prepareAnswer($result);
	}
开发者ID:ASDAFF,项目名称:bitrix-5,代码行数:7,代码来源:bitrix24.php

示例12: GetCurrentUserFriends

 public function GetCurrentUserFriends($limit, &$next)
 {
     if ($this->access_token === false) {
         return false;
     }
     if (empty($next)) {
         $url = self::GRAPH_URL . '/me/friends?access_token=' . $this->access_token . "&fields=picture,id,name,first_name,last_name,gender,birthday,email";
         if ($limit > 0) {
             $url .= "&limit=" . intval($limit) . "&offset=" . intval($next);
         }
     } else {
         $url = $next;
     }
     $result = CHTTP::sGetHeader($url, array(), $this->httpTimeout);
     if (!defined("BX_UTF")) {
         $result = CharsetConverter::ConvertCharset($result, "utf-8", LANG_CHARSET);
     }
     $result = CUtil::JsObjectToPhp($result);
     if (is_array($result['paging']) && !empty($result['paging']['next'])) {
         $next = $result['paging']['next'];
     } else {
         $next = '';
     }
     return $result;
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:25,代码来源:facebook.php

示例13: GetAccessToken

 public function GetAccessToken($redirect_uri)
 {
     $token = $this->getStorageTokens();
     if (is_array($token)) {
         $this->access_token = $token["OATOKEN"];
         $this->accessTokenExpires = $token["OATOKEN_EXPIRES"];
         if ($this->checkAccessToken()) {
             return true;
         }
     }
     if ($this->code === false) {
         return false;
     }
     $result = CHTTP::sGetHeader(self::GRAPH_URL . '/oauth/access_token?client_id=' . $this->appID . '&client_secret=' . $this->appSecret . '&redirect_uri=' . urlencode($redirect_uri) . '&code=' . urlencode($this->code), array(), $this->httpTimeout);
     $arResult = array();
     $arResultLongLive = array();
     parse_str($result, $arResult);
     if (isset($arResult["access_token"]) && $arResult["access_token"] != '') {
         $result = CHTTP::sGetHeader(self::GRAPH_URL . "/oauth/access_token?grant_type=fb_exchange_token&client_id=" . $this->appID . "&client_secret=" . $this->appSecret . "&fb_exchange_token=" . $arResult["access_token"], array(), $this->httpTimeout);
         parse_str($result, $arResultLongLive);
         if (isset($arResultLongLive["access_token"]) && $arResultLongLive["access_token"] != '') {
             $arResult["access_token"] = $arResultLongLive["access_token"];
             $arResult["expires"] = $arResultLongLive["expires"];
             $_SESSION["OAUTH_DATA"] = array("OATOKEN" => $arResultLongLive["access_token"], "OATOKEN_EXPIRES" => time() + $arResultLongLive['expires']);
         }
         $this->access_token = $arResult["access_token"];
         $this->accessTokenExpires = time() + $arResult["expires"];
         return true;
     }
     return false;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:31,代码来源:facebook.php


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