本文整理汇总了PHP中CHTTP::sGet方法的典型用法代码示例。如果您正苦于以下问题:PHP CHTTP::sGet方法的具体用法?PHP CHTTP::sGet怎么用?PHP CHTTP::sGet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CHTTP
的用法示例。
在下文中一共展示了CHTTP::sGet方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetOpenIDServerTags
function GetOpenIDServerTags($url)
{
if ($str = @CHTTP::sGet($url, true))
{
$server = '';
$delegate = '';
if (preg_match('/<link[^>]+rel=(["\'])([^>"]*\s)?openid\.server(\s[^>"]*)?\1[^>]*>/i', $str, $arLinks))
if (preg_match('/href=["\']([^"|\']+)["\']/i', $arLinks[0], $arHref))
$server = $arHref[1];
if (preg_match('/<link[^>]+rel=(["\'])([^>"]*\s)?openid.delegate(\s[^>"]*)?\1[^>]*>/i', $str, $arLinks))
if (preg_match('/href=["\']([^"|\']+)["\']/i', $arLinks[0], $arHref))
$delegate = $arHref[1];
if (strlen($server) <= 0)
{
$GLOBALS['APPLICATION']->ThrowException(GetMessage('OPENID_CLIENT_NO_OPENID_SERVER_TAG'));
return false;
}
return array('server' => $server, 'delegate' => $delegate);
}
$GLOBALS['APPLICATION']->ThrowException(GetMessage('OPENID_CLIENT_NO_OPENID_SERVER_TAG'));
return false;
}
示例2: GetCurrentUser
public function GetCurrentUser()
{
if($this->access_token === false)
return false;
$result = CHTTP::sGet(self::CONTACTS_URL."?access_token=".urlencode($this->access_token));
if(!defined("BX_UTF"))
$result = CharsetConverter::ConvertCharset($result, "utf-8", LANG_CHARSET);
return CUtil::JsObjectToPhp($result);
}
示例3: doRequestToLocalhost
/**
* Make request to current site and return result
* @param string $pPath - url path, e.g. /upload/tmp/test.php
* @return bool|string
*/
protected static function doRequestToLocalhost($pPath)
{
$url = self::getCurrentSiteUrl();
$url .= $pPath;
$url .= "?" . mt_rand();
//Prevent web-server cache
return @CHTTP::sGet($url);
}
示例4: GetCurrentUser
public function GetCurrentUser()
{
if($this->access_token === false)
return false;
$result = CHTTP::sGet(self::GRAPH_URL.'/me?access_token='.$this->access_token."&fields=picture,id,name,first_name,last_name,gender,birthday,email");
if(!defined("BX_UTF"))
$result = CharsetConverter::ConvertCharset($result, "utf-8", LANG_CHARSET);
return CUtil::JsObjectToPhp($result);
}
示例5: GetAllPagesNotAuth
private function GetAllPagesNotAuth($arResult)
{
static $arTwits = array();
if (!isset($arResult["next_page"]) || $arResult["page"] == 15 || intval($arResult["page"]) < 1) {
return $arTwits;
}
$result = CHTTP::sGet(self::SEARCH_URL . $arResult["next_page"]);
if (!defined("BX_UTF")) {
$result = CharsetConverter::ConvertCharset($result, "utf-8", LANG_CHARSET);
}
$arResult = CUtil::JsObjectToPhp($result);
$arTwits = array_merge($arTwits, $arResult["results"]);
return self::GetAllPages($arResult);
}
示例6: GetCurrentUser
public function GetCurrentUser()
{
if($this->access_token === false)
return false;
$result = CHTTP::sGet(self::CONTACTS_URL.'contacts/default/full?v=3.0&alt=json&oauth_token='.urlencode($this->access_token));
return CUtil::JsObjectToPhp($result);
}
示例7: GetCurrentUser
public function GetCurrentUser()
{
if($this->access_token === false)
return false;
$result = CHTTP::sGet(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));
if(!defined("BX_UTF"))
$result = CharsetConverter::ConvertCharset($result, "utf-8", LANG_CHARSET);
return CUtil::JsObjectToPhp($result);
}
示例8: 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::sGet(self::CONTACTS_URL.'?method=users.getInfo&secure=1&app_id='.$this->appID.'&session_key='.urlencode($this->access_token).'&sig='.$sign);
if(!defined("BX_UTF"))
$result = CharsetConverter::ConvertCharset($result, "utf-8", LANG_CHARSET);
return CUtil::JsObjectToPhp($result);
}
示例9: GetUserInfo
public function GetUserInfo($user_id)
{
$result = CHTTP::sGet(self::API_URL.'users/show.json?user_id='.$user_id);
return CUtil::JsObjectToPhp($result);
}
示例10: GetUserInfo
public function GetUserInfo($user_id)
{
$result = CHTTP::sGet(self::API_URL.'users/show.json?user_id='.$user_id);
if(!defined("BX_UTF"))
$result = CharsetConverter::ConvertCharset($result, "utf-8", LANG_CHARSET);
return CUtil::JsObjectToPhp($result);
}
示例11: fetch
function fetch($url)
{
/*
if (!($handle = fopen($url, "rb"))) {
WindowsLiveLogin::debug("error: fetch: Could not open url: $url");
return;
}
if (!($contents = stream_get_contents($handle))) {
WindowsLiveLogin::debug("Error: fetch: Could not read from url: $url");
}
fclose($handle);
*/
//$str = $url."\n\n".$contents."\n\n\n";
//file_put_contents(__FILE__ . '.ftech.log', $str, FILE_APPEND);
$contents = CHTTP::sGet($url, false);
return $contents;
}
示例12: 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::sGet(self::CONTACTS_URL."?method=users.setStatus&application_key=".$this->appKey."&access_token=".$this->access_token."&sig=".$this->sign."&status=".urlencode($message));
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;
}
示例13: GetCurrentUser
public function GetCurrentUser()
{
if($this->access_token === false)
return false;
$result = CHTTP::sGet(self::CONTACTS_URL."?method=users.getCurrentUser&application_key=".$this->appKey."&access_token=".$this->access_token."&sig=".$this->sign);
if(!defined("BX_UTF"))
$result = CharsetConverter::ConvertCharset($result, "utf-8", LANG_CHARSET);
return CUtil::JsObjectToPhp($result);
}