• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP CHTTP类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: SendCDNRequest

 public function SendCDNRequest($settings, $verb, $bucket, $file_name = '', $params = '', $content = false, $additional_headers = array())
 {
     $arToken = $this->_GetToken($settings["HOST"], $settings["USER"], $settings["KEY"]);
     if (!$arToken) {
         return false;
     }
     if (isset($arToken["X-CDN-Management-Url"])) {
         if (preg_match("#^http://(.*?)(|:\\d+)(/.*)\$#", $arToken["X-CDN-Management-Url"], $arCDN)) {
             $Host = $arCDN[1];
             $Port = $arCDN[2] ? substr($arCDN[2], 1) : 80;
             $Urn = $arCDN[3];
             $Proto = "";
         } elseif (preg_match("#^https://(.*?)(|:\\d+)(/.*)\$#", $arToken["X-CDN-Management-Url"], $arCDN)) {
             $Host = $arCDN[1];
             $Port = $arCDN[2] ? substr($arCDN[2], 1) : 443;
             $Urn = $arCDN[3];
             $Proto = "ssl://";
         } else {
             return false;
         }
     } else {
         return false;
     }
     $obRequest = new CHTTP();
     $obRequest->additional_headers["X-Auth-Token"] = $arToken["X-Auth-Token"];
     foreach ($additional_headers as $key => $value) {
         $obRequest->additional_headers[$key] = $value;
     }
     $obRequest->Query($verb, $Host, $Port, $Urn . CCloudUtil::URLEncode("/" . $bucket . $file_name . $params, "UTF-8"), $content, $Proto);
     return $obRequest;
 }
开发者ID:andy-profi,项目名称:bxApiDocs,代码行数:31,代码来源:storage_service_rackspace.php


示例2: SendRequest

 function SendRequest($access_key, $secret_key, $verb, $bucket, $file_name = '/', $params = '')
 {
     global $APPLICATION;
     $this->status = 0;
     $RequestMethod = $verb;
     $RequestHost = "sts.amazonaws.com";
     $RequestURI = "/";
     $RequestParams = "";
     $params['SignatureVersion'] = 2;
     $params['SignatureMethod'] = 'HmacSHA1';
     $params['AWSAccessKeyId'] = $access_key;
     $params['Timestamp'] = gmdate('Y-m-d') . 'T' . gmdate('H:i:s');
     //.preg_replace("/(\d\d)\$/", ":\\1", date("O"));
     $params['Version'] = '2011-06-15';
     ksort($params);
     foreach ($params as $name => $value) {
         if ($RequestParams != '') {
             $RequestParams .= '&';
         }
         $RequestParams .= urlencode($name) . "=" . urlencode($value);
     }
     $StringToSign = "{$RequestMethod}\n" . "{$RequestHost}\n" . "{$RequestURI}\n" . "{$RequestParams}";
     $Signature = urlencode(base64_encode($this->hmacsha1($StringToSign, $secret_key)));
     $obRequest = new CHTTP();
     $obRequest->Query($RequestMethod, $RequestHost, 443, $RequestURI . "?{$RequestParams}&Signature={$Signature}", false, 'ssl://');
     $this->status = $obRequest->status;
     $this->headers = $obRequest->headers;
     $this->errno = $obRequest->errno;
     $this->errstr = $obRequest->errstr;
     $this->result = $obRequest->result;
     if ($obRequest->status == 200) {
         if ($obRequest->result) {
             $obXML = new CDataXML();
             $text = preg_replace("/<" . "\\?XML.*?\\?" . ">/i", "", $obRequest->result);
             if ($obXML->LoadString($text)) {
                 $arXML = $obXML->GetArray();
                 if (is_array($arXML)) {
                     return $arXML;
                 }
             }
             //XML parse error
             $APPLICATION->ThrowException(GetMessage('CLO_SECSERV_S3_XML_PARSE_ERROR', array('#errno#' => 1)));
             return false;
         } else {
             //Empty success result
             return array();
         }
     } elseif ($obRequest->status > 0) {
         if ($obRequest->result) {
             $APPLICATION->ThrowException(GetMessage('CLO_SECSERV_S3_XML_ERROR', array('#errmsg#' => $obRequest->result)));
             return false;
         }
         $APPLICATION->ThrowException(GetMessage('CLO_SECSERV_S3_XML_PARSE_ERROR', array('#errno#' => 2)));
         return false;
     } else {
         $APPLICATION->ThrowException(GetMessage('CLO_SECSERV_S3_XML_PARSE_ERROR', array('#errno#' => 3)));
         return false;
     }
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:59,代码来源:security_service_s3.php


示例3: GetBoardFromSite

 function GetBoardFromSite($queryParameters)
 {
     global $APPLICATION;
     $result = array();
     $ob = new CHTTP();
     $ob->http_timeout = 60;
     $ob->Query("GET", "old.vnukovo.ru", 80, "/rus/for-passengers/board1/data.wbp?" . $queryParameters . '&ts=' . mktime(), false, "", "N");
     $result["ERROR"]["CODE"] = $ob->errno;
     $result["ERROR"]["MESSAGE"] = $ob->errstr;
     if (!intval($result["ERROR"]["CODE"])) {
         $res = $APPLICATION->ConvertCharset($ob->result, "UTF-8", SITE_CHARSET);
         //trace($res);
         $xml = new CDataXML();
         if ($xml->LoadString($res) && ($node = $xml->SelectNodes("/responce/rows"))) {
             $rows = $node->elementsByName("row");
             $akNames = array();
             $akCodes = array();
             $departures = array();
             $arrivals = array();
             $terminals = array();
             foreach ($rows as $row) {
                 $cells = $row->elementsByName("cell");
                 // Определяем код авиакомпании и номер рейса
                 preg_match_all("/([A-Za-zА-Яа-я0-9]{2})[\\s]*([0-9]+)/", $cells[0]->content, $flightNumber, PREG_PATTERN_ORDER);
                 $result["FLIGHTS"][] = array("FLIGHT" => array("AK_CODE" => $flightNumber[1][0], "NUMBER" => $flightNumber[2][0]), "AK_NAME" => htmlspecialcharsEx($cells[1]->content), "DEPARTURE" => htmlspecialcharsEx($cells[2]->content), "ARRIVAL" => htmlspecialcharsEx($cells[3]->content), "STATUS" => CAirportBoard::GetStatusInfo($cells[4]->content), "TIME" => array("PLANNED" => CAirportBoard::GetDateTimeArray($cells[5]->content), "ESTIMATED" => CAirportBoard::GetDateTimeArray($cells[6]->content), "ACTUAL" => CAirportBoard::GetDateTimeArray($cells[7]->content)), "TERMINAL" => htmlspecialcharsEx($cells[8]->content));
                 // Формируем список уникальных авиакомпаний, терминалов и пунктов вылета и прилета для фильтра
                 if (!in_array(htmlspecialcharsEx($cells[1]->content), $akNames)) {
                     $akNames[] = htmlspecialcharsEx($cells[1]->content);
                 }
                 if (!in_array($flightNumber[1][0], $akCodes)) {
                     $akCodes[] = $flightNumber[1][0];
                 }
                 if (!in_array(htmlspecialcharsEx($cells[2]->content), $departures)) {
                     $departures[] = htmlspecialcharsEx($cells[2]->content);
                 }
                 if (!in_array(htmlspecialcharsEx($cells[3]->content), $arrivals)) {
                     $arrivals[] = htmlspecialcharsEx($cells[3]->content);
                 }
                 if (!in_array(htmlspecialcharsEx($cells[8]->content), $terminals)) {
                     $terminals[] = htmlspecialcharsEx($cells[8]->content);
                 }
             }
             sort($akNames);
             sort($akCodes);
             sort($departures);
             sort($arrivals);
             sort($terminals);
             $result["AK_NAMES"] = $akNames;
             $result["AK_CODES"] = $akCodes;
             $result["DEPARTURES"] = $departures;
             $result["ARRIVALS"] = $arrivals;
             $result["TERMINALS"] = $terminals;
         }
     }
     return $result;
 }
开发者ID:slavaskazochnik,项目名称:vnukovo-transagency,代码行数:56,代码来源:vko.php


示例4: action

 /**
  * Returns action response XML
  *
  * @param string $action
  * @return CDataXML
  * @throws CBitrixCloudException
  */
 protected function action($action)
 {
     /** @global CMain $APPLICATION */
     global $APPLICATION;
     $url = $this->getActionURL(array("action" => $action, "debug" => $this->debug ? "y" : "n"));
     $server = new CHTTP();
     $strXML = $server->Get($url);
     if ($strXML === false) {
         $e = $APPLICATION->GetException();
         if (is_object($e)) {
             throw new CBitrixCloudException($e->GetString(), "");
         } else {
             throw new CBitrixCloudException(GetMessage("BCL_CDN_WS_SERVER", array("#STATUS#" => "-1")), "");
         }
     }
     if ($server->status != 200) {
         throw new CBitrixCloudException(GetMessage("BCL_CDN_WS_SERVER", array("#STATUS#" => (string) $server->status)), "");
     }
     $obXML = new CDataXML();
     if (!$obXML->LoadString($strXML)) {
         throw new CBitrixCloudException(GetMessage("BCL_CDN_WS_XML_PARSE", array("#CODE#" => "1")), "");
     }
     $node = $obXML->SelectNodes("/error/code");
     if (is_object($node)) {
         $error_code = $node->textContent();
         $message_id = "BCL_CDN_WS_" . $error_code;
         /*
         GetMessage("BCL_CDN_WS_LICENSE_EXPIRE");
         GetMessage("BCL_CDN_WS_LICENSE_NOT_FOUND");
         GetMessage("BCL_CDN_WS_QUOTA_EXCEEDED");
         GetMessage("BCL_CDN_WS_CMS_LICENSE_NOT_FOUND");
         GetMessage("BCL_CDN_WS_DOMAIN_NOT_REACHABLE");
         GetMessage("BCL_CDN_WS_LICENSE_DEMO");
         GetMessage("BCL_CDN_WS_LICENSE_NOT_ACTIVE");
         GetMessage("BCL_CDN_WS_NOT_POWERED_BY_BITRIX_CMS");
         GetMessage("BCL_CDN_WS_WRONG_DOMAIN_SPECIFIED");
         */
         $debug_content = "";
         $node = $obXML->SelectNodes("/error/debug");
         if (is_object($node)) {
             $debug_content = $node->textContent();
         }
         //if (HasMessage($message_id))
         //    throw new CBitrixCloudException(GetMessage($message_id), $error_code, $debug_content);
         //else
         //    throw new CBitrixCloudException(GetMessage("BCL_CDN_WS_SERVER", array(
         //        "#STATUS#" => $error_code,
         //    )), $error_code, $debug_content);
     }
     return $obXML;
 }
开发者ID:k-kalashnikov,项目名称:geekcon.local,代码行数:58,代码来源:webservice.php


示例5: AddByChannel

	public static function AddByChannel($channelId, $arMessage)
	{
		global $DB;

		if (strlen($arMessage['module_id'])<=0 || strlen($arMessage['command'])<=0)
			return false;


		$arData = Array(
			'module_id' => $arMessage['module_id'],
			'command' => $arMessage['command'],
			'params' => is_array($arMessage['params'])?$arMessage['params']: Array(),
		);
		if (CPullOptions::GetNginxStatus())
		{
			$message = CUtil::PhpToJsObject(Array('CHANNEL_ID' => $channelId, 'MESSAGE' => Array($arData), 'ERROR' => ''));
			if (!defined('BX_UTF') || !BX_UTF)
				$message = $GLOBALS['APPLICATION']->ConvertCharset($message, SITE_CHARSET,'utf-8');

			$CHTTP = new CHTTP();
			$CHTTP->http_timeout = 10;
			if ($CHTTP->HTTPQuery('POST', CPullOptions::GetPublishUrl($channelId), str_replace("\n", " ", $message)))
				$result = $CHTTP->result;
		}
		else
		{
			$arParams = Array(
				'CHANNEL_ID' => $channelId,
				'MESSAGE' => str_replace("\n", " ", serialize($arData)),
				'~DATE_CREATE' => $DB->CurrentTimeFunction(),
			);
			$id = IntVal($DB->Add("b_pull_stack", $arParams, Array("MESSAGE")));
			$result = $id? '{"channel": "'.$channelId.'", "id": "'.$id.'"}': false;
		}

		if (isset($arMessage['push_text']) && strlen($arMessage['push_text'])>0
		&& isset($arMessage['push_user']) && intval($arMessage['push_user'])>0)
		{
			$CPushManager = new CPushManager();
			$CPushManager->AddQueue(Array(
				'USER_ID' => $arMessage['push_user'],
				'MESSAGE' => str_replace("\n", " ", $arMessage['push_text']),
				'PARAMS' => $arMessage['push_params'],
				'TAG' => isset($arMessage['push_tag'])? $arMessage['push_tag']: '',
			));
		}

		return $result;
	}
开发者ID:ASDAFF,项目名称:bitrix-5,代码行数:49,代码来源:pull_stack.php


示例6: GetOneBoardFromSite

 function GetOneBoardFromSite($queryParameters, $addQueryParameters)
 {
     global $APPLICATION;
     $ob = new CHTTP();
     $ob->http_timeout = 60;
     $ob->Query("GET", "www.pulkovoairport.ru", 80, "/online_serves/online_timetable/" . $queryParameters . '?ts=' . mktime() . (strlen($addQueryParameters) ? '&' . $addQueryParameters : ''), false, "", "N");
     $res = $APPLICATION->ConvertCharset($ob->result, "KOI8-R", SITE_CHARSET);
     $res = str_replace('<table class="tablo tabloBigNew bigTableZebra" border="0">', "++++", $res);
     $res = str_replace('</div> <!-- / gridTbox -->', "++++", $res);
     $explode = explode("++++", $res);
     $res = $explode[1];
     $res = substr($res, 0, strlen($res) - 22);
     return array("ERROR" => array("CODE" => $ob->errno, "MESSAGE" => $ob->errstr), "HTML" => $res);
     unset($explode, $res);
 }
开发者ID:slavaskazochnik,项目名称:vnukovo-transagency,代码行数:15,代码来源:led.php


示例7: __MPF_ImageResizeHandler

 function __MPF_ImageResizeHandler(&$arCustomFile, $params = array(), $result = array())
 {
     static $arParams = array();
     if (!empty($params)) {
         $arParams = $params;
     }
     static $arResult = array();
     if (!empty($result)) {
         $arResult = $result;
     }
     $fileIdForDelete = 0;
     $arFields = array();
     foreach (array("MELODY_WELCOME", "MELODY_WAIT", "MELODY_HOLD", "MELODY_VOICEMAIL") as $controlID => $inputName) {
         if ($_REQUEST["controlID"] == "voximplant" . $controlID) {
             $fileIdForDelete = $arResult["ITEM"][$inputName];
             $arFields = array($inputName => $arCustomFile["fileID"]);
             break;
         }
     }
     if (!empty($arFields)) {
         $arFile = CFile::GetFileArray($arCustomFile['fileID']);
         $arCustomFile["fileURL"] = CHTTP::URN2URI($arFile["SRC"]);
         Bitrix\Voximplant\ConfigTable::update($arParams["ID"], $arFields);
         CFile::Delete($fileIdForDelete);
     }
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:26,代码来源:result_modifier.php


示例8: getFriendsList

 public function getFriendsList($limit, &$next)
 {
     if (IsModuleInstalled('bitrix24') && defined('BX24_HOST_NAME')) {
         $redirect_uri = static::CONTROLLER_URL . "/redirect.php";
     } else {
         $redirect_uri = \CHTTP::URN2URI("/bitrix/tools/oauth/google.php");
     }
     $ob = $this->getEntityOAuth();
     if ($ob->GetAccessToken($redirect_uri) !== false) {
         $res = $ob->getCurrentUserFriends($limit, $next);
         foreach ($res["items"] as $key => $contact) {
             $contact["uid"] = $contact["id"];
             if (array_key_exists("name", $contact)) {
                 $contact["first_name"] = $contact["name"]["givenName"];
                 $contact["last_name"] = $contact["name"]["familyName"];
             } else {
                 list($contact["first_name"], $contact["last_name"]) = explode(" ", $contact["displayName"], 2);
             }
             if (array_key_exists("image", $contact)) {
                 $contact["picture"] = preg_replace("/\\?.*\$/", "", $contact["image"]["url"]);
             }
             $res["items"][$key] = $contact;
         }
         return $res["items"];
     }
     return false;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:27,代码来源:googleplus.php


示例9: GetOneBoardFromSite

 function GetOneBoardFromSite($queryParameters, $addQueryParameters)
 {
     global $APPLICATION;
     $ob = new CHTTP();
     $ob->http_timeout = 60;
     $ob->Query("GET", "www.domodedovo.ru", 80, "/onlinetablo/?" . $queryParameters . (strlen($addQueryParameters) ? '&' . $addQueryParameters : '') . '&ts=' . mktime(), false, "", "N");
     $res = $APPLICATION->ConvertCharset($ob->result, "UTF-8", SITE_CHARSET);
     $res = str_replace('<table cellspacing="1" cellpadding="3" width="100%" border="0" id="onlinetablo" >', "++++", $res);
     $res = str_replace('</form>', "++++", $res);
     $explode = explode("++++", $res);
     $res = $explode[1];
     $res = str_replace('</table>', "++++", $res);
     $explode = explode("++++", $res);
     $res = $explode[0];
     return array("ERROR" => array("CODE" => $ob->errno, "MESSAGE" => $ob->errstr), "HTML" => $res);
     unset($explode, $res);
 }
开发者ID:slavaskazochnik,项目名称:vnukovo-transagency,代码行数:17,代码来源:dme.php


示例10: Add

 public static function Add($userId)
 {
     global $DB, $APPLICATION;
     $channelId = md5(uniqid() . $_SERVER["REMOTE_ADDR"] . $_SERVER["SERVER_NAME"] . (is_object($APPLICATION) ? $APPLICATION->GetServerUniqID() : ''));
     $arParams = array('USER_ID' => intval($userId), 'CHANNEL_ID' => $channelId, 'LAST_ID' => 0, '~DATE_CREATE' => $DB->CurrentTimeFunction());
     $result = IntVal($DB->Add("b_pull_channel", $arParams, array()));
     if (CPullOptions::GetNginxStatus()) {
         $result = false;
         $arData = array('module_id' => 'pull', 'command' => 'open', 'params' => array());
         $CHTTP = new CHTTP();
         $CHTTP->http_timeout = 10;
         if ($CHTTP->HTTPQuery('POST', CPullOptions::GetPublishUrl($channelId), CUtil::PhpToJsObject(array('MESSAGE' => array($arData), 'ERROR' => '')))) {
             $result = $CHTTP->result;
         }
     }
     return $result ? $channelId : false;
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:17,代码来源:pull_channel.php


示例11: MultySend

 function MultySend($arNumbers, $message)
 {
     if (!empty($arNumbers)) {
         if (!defined("BX_UTF")) {
             $message = iconv("windows-1251", "utf-8", $message);
         }
         $res = new CHTTP();
         $token = $res->Get("http://sms.ru/auth/get_token");
         $arrep = array(" ", ",", "(", ")", "-");
         foreach ($arNumbers as $k => $v) {
             $arNumbers[$k] = str_replace($arrep, "", $v);
         }
         $arr = array("login" => COption::GetOptionString("echogroup.smsru", "LOGIN"), "sha512" => hash("sha512", COption::GetOptionString("echogroup.smsru", "PASSWORD") . $token . COption::GetOptionString("echogroup.smsru", "API_KEY")), "token" => $token, "to" => implode($arNumbers, $number), "text" => $message);
         $html = $res->Post("http://sms.ru/sms/send", $arr);
         return $html;
     }
 }
开发者ID:Hawkart,项目名称:megatv,代码行数:17,代码来源:include.php


示例12: Redirect404

function Redirect404()
{
    if (!defined('ADMIN_SECTION') && defined('ERROR_404')) {
        global $APPLICATION;
        $APPLICATION->RestartBuffer();
        CHTTP::SetStatus('404 Not Found');
        $tplPath = BASE_PATH . '/local/templates/404/';
        include "{$tplPath}/header.php";
        include "{$tplPath}/footer.php";
    }
}
开发者ID:AlexSmerw,项目名称:domino,代码行数:11,代码来源:init.php


示例13: getActionURL

 /**
  * Returns URL to backup webservice
  *
  * @param array[string]string $arParams
  * @return string
  *
  */
 protected function getActionURL($arParams = array())
 {
     $arParams["license"] = md5(LICENSE_KEY);
     $arParams["spd"] = $this->spd;
     $arParams["lang"] = LANGUAGE_ID;
     $arParams["file_name"] = $this->file_name;
     $arParams["check_word"] = $this->check_word;
     $url = COption::GetOptionString("bitrixcloud", "backup_policy_url");
     $url = CHTTP::urlAddParams($url, $arParams, array("encode" => true));
     return $url;
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:18,代码来源:backup_webservice.php


示例14: getActionURL

 /**
  * Returns URL to backup webservice
  *
  * @param array[string]string $arParams
  * @return string
  *
  */
 protected function getActionURL($arParams = array())
 {
     $arParams["license"] = md5(LICENSE_KEY);
     $arParams["spd"] = CUpdateClient::getSpd();
     foreach ($this->addParams as $key => $value) {
         $arParams[$key] = $value;
     }
     $url = COption::GetOptionString("bitrixcloud", "monitoring_policy_url");
     $url = CHTTP::urlAddParams($url, $arParams, array("encode" => true)) . $this->addStr;
     return $url;
 }
开发者ID:spas-viktor,项目名称:books,代码行数:18,代码来源:monitoring_webservice.php


示例15: getRightsLinks

 static function getRightsLinks($arPage)
 {
     global $arParams, $APPLICATION;
     if (!is_array($arPage)) {
         $arPage = array($arPage);
     }
     $arLinks = array();
     $arParams['ELEMENT_NAME'] = htmlspecialcharsback($arParams['ELEMENT_NAME']);
     $arParams['ELEMENT_NAME'] = urlencode($arParams['ELEMENT_NAME']);
     if (in_array('categories', $arPage)) {
         return array();
     }
     if (in_array('article', $arPage) && !in_array('add', $arPage)) {
         $arLinks['article'] = array('NAME' => GetMessage('PAGE_ARTICLE'), 'TITLE' => GetMessage('PAGE_ARTICLE_TITLE'), 'CURRENT' => in_array('article', $arPage), 'LINK' => CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_POST'], array('wiki_name' => $arParams['ELEMENT_NAME'], 'group_id' => CWikiSocnet::$iSocNetId)), 'ID' => 'article', 'TYPE' => 'page', 'IS_RED' => in_array('add', $arPage) ? 'Y' : 'N');
     }
     if (self::IsWriteable() && ((!in_array('history', $arPage) || in_array('history_diff', $arPage)) && (!in_array('add', $arPage) && !in_array('edit', $arPage) && !in_array('delete', $arPage) && !in_array('rename', $arPage)))) {
         if (IsModuleInstalled('bizproc')) {
             $arLinks['history'] = array('NAME' => GetMessage('PAGE_HISTORY'), 'TITLE' => GetMessage('PAGE_HISTORY_TITLE'), 'CURRENT' => in_array('history', $arPage), 'LINK' => CHTTP::urlAddParams(CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_HISTORY'], array('wiki_name' => $arParams['ELEMENT_NAME'], 'group_id' => CWikiSocnet::$iSocNetId)), $arParams['IN_COMPLEX'] == 'Y' && $arParams['SEF_MODE'] == 'N' ? array($arParams['OPER_VAR'] => 'history') : array()), 'ID' => 'history', 'TYPE' => 'page', 'IS_RED' => 'N');
         }
     }
     if ($arParams['USE_REVIEW'] == 'Y') {
         $arLinks['discussion'] = array('NAME' => GetMessage('PAGE_DISCUSSION'), 'TITLE' => GetMessage('PAGE_DISCUSSION_TITLE'), 'CURRENT' => in_array('discussion', $arPage), 'LINK' => CHTTP::urlAddParams(CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_DISCUSSION'], array('wiki_name' => $arParams['ELEMENT_NAME'], 'group_id' => CWikiSocnet::$iSocNetId)), $arParams['IN_COMPLEX'] == 'Y' && $arParams['SEF_MODE'] == 'N' ? array($arParams['OPER_VAR'] => 'discussion') : array()), 'ID' => 'discussion', 'TYPE' => 'page', 'IS_RED' => 'N');
     }
     if (self::IsWriteable() && (!in_array('history', $arPage) && !in_array('history_diff', $arPage))) {
         $arLinks['add'] = array('NAME' => GetMessage('PAGE_ADD'), 'TITLE' => GetMessage('PAGE_ADD_TITLE'), 'CURRENT' => in_array('add', $arPage), 'LINK' => CHTTP::urlAddParams(CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_POST_EDIT'], array('wiki_name' => GetMessage('WIKI_NEW_PAGE_TITLE'), 'group_id' => CWikiSocnet::$iSocNetId)), array($arParams['OPER_VAR'] => 'add')), 'ID' => 'add', 'TYPE' => 'edit', 'IS_RED' => in_array('add', $arPage) ? 'Y' : 'N');
         if (!in_array('add', $arPage)) {
             $arLinks['edit'] = array('NAME' => GetMessage('PAGE_EDIT'), 'TITLE' => GetMessage('PAGE_EDIT_TITLE'), 'CURRENT' => in_array('edit', $arPage), 'LINK' => CHTTP::urlAddParams(CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_POST_EDIT'], array('wiki_name' => $arParams['ELEMENT_NAME'], 'group_id' => CWikiSocnet::$iSocNetId)), $arParams['IN_COMPLEX'] == 'Y' && $arParams['SEF_MODE'] == 'N' ? array($arParams['OPER_VAR'] => 'edit') : array()), 'ID' => 'edit', 'TYPE' => 'edit', 'IS_RED' => in_array('add', $arPage) ? 'Y' : 'N');
             $url = $APPLICATION->GetPopupLink(array('URL' => CHTTP::urlAddParams(CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_POST_EDIT'], array('wiki_name' => urlencode($arParams['ELEMENT_NAME']), 'group_id' => CWikiSocnet::$iSocNetId)), array($arParams['OPER_VAR'] => 'rename')), 'PARAMS' => array('width' => 400, 'height' => 150, 'resizable' => false)));
             $arLinks['rename'] = array('NAME' => GetMessage('WIKI_PAGE_RENAME'), 'TITLE' => GetMessage('WIKI_PAGE_RENAME_TITLE'), 'CURRENT' => in_array('rename', $arPage), 'LINK' => 'javascript:' . $url, 'ID' => 'rename', 'TYPE' => 'page');
             if (self::IsDeleteable()) {
                 $url = $APPLICATION->GetPopupLink(array('URL' => CHTTP::urlAddParams(CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_POST_EDIT'], array('wiki_name' => $arParams['ELEMENT_ID'], 'group_id' => CWikiSocnet::$iSocNetId)), array($arParams['OPER_VAR'] => 'delete')), 'PARAMS' => array('width' => 400, 'height' => 150, 'resizable' => false)));
                 $arLinks['delete'] = array('NAME' => GetMessage('PAGE_DELETE'), 'TITLE' => GetMessage('PAGE_DELETE_TITLE'), 'CURRENT' => in_array('delete', $arPage), 'LINK' => 'javascript:' . $url, 'ID' => 'delete', 'TYPE' => 'edit', 'IS_RED' => 'N');
             }
         }
         /**	$arLinks['access'] = array(
         				'NAME' => GetMessage('PAGE_ACCESS'),
         				'TITLE' => GetMessage('PAGE_ACCESS_TITLE'),
         				'CURRENT' => in_array('access', $arPage),
         				'LINK' => CHTTP::urlAddParams(
         					CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_POST_EDIT'],
         						array(
         							'wiki_name' => $arParams['ELEMENT_NAME'],
         							'group_id' => CWikiSocnet::$iSocNetId
         						)
         					),
         					array($arParams['OPER_VAR'] => 'access')
         				),
         				'ID' => 'access',
         				'TYPE' => 'edit',
         				'IS_RED' => 'N'
         			); **/
     }
     return $arLinks;
 }
开发者ID:rasuldev,项目名称:torino,代码行数:54,代码来源:wiki_utils.php


示例16: getActionURL

 /**
  * Returns URL to backup webservice
  *
  * @param array[string]string $arParams
  * @return string
  *
  */
 protected function getActionURL($arParams = array())
 {
     $arParams["license"] = md5(LICENSE_KEY);
     $arParams["lang"] = LANGUAGE_ID;
     foreach ($this->addParams as $key => $value) {
         $arParams[$key] = $value;
     }
     $url = COption::GetOptionString("bitrixcloud", "backup_policy_url");
     $url = CHTTP::urlAddParams($url, $arParams, array("encode" => true)) . $this->addStr;
     return $url;
 }
开发者ID:spas-viktor,项目名称:books,代码行数:18,代码来源:backup_webservice.php


示例17: findCorrectFile

 function findCorrectFile($path, &$strWarn, $warning = false)
 {
     $arUrl = CHTTP::ParseURL($path);
     if ($arUrl && is_array($arUrl)) {
         if (isset($arUrl['host'], $arUrl['scheme'])) {
             if (strpos($arUrl['host'], 'xn--') !== false) {
                 // Do nothing
             } else {
                 $originalPath = $path;
                 $path = $arUrl['scheme'] . '://' . $arUrl['host'];
                 $arErrors = array();
                 if (defined("BX_UTF")) {
                     $punicodedPath = CBXPunycode::ToUnicode($path, $arErrors);
                 } else {
                     $punicodedPath = CBXPunycode::ToASCII($path, $arErrors);
                 }
                 if ($punicodedPath == $path) {
                     return $originalPath;
                 } else {
                     $path = $punicodedPath;
                 }
                 if ($arUrl['port'] && ($arUrl['port'] != 80 && $arUrl['port'] != 443)) {
                     $path .= ':' . $arUrl['port'];
                 }
                 $path .= $arUrl['path_query'];
             }
         } else {
             $DOC_ROOT = $_SERVER["DOCUMENT_ROOT"];
             $path = Rel2Abs("/", $path);
             $path_ = $path;
             $io = CBXVirtualIo::GetInstance();
             if (!$io->FileExists($DOC_ROOT . $path)) {
                 if (CModule::IncludeModule('clouds')) {
                     $path = CCloudStorage::FindFileURIByURN($path, "component:player");
                     if ($path == "") {
                         if ($warning) {
                             $strWarn .= $warning . "<br />";
                         }
                         $path = $path_;
                     }
                 } else {
                     if ($warning) {
                         $strWarn .= $warning . "<br />";
                     }
                     $path = $path_;
                 }
             }
         }
     }
     return $path;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:51,代码来源:component.php


示例18: AddByChannel

 public static function AddByChannel($channelId, $arMessage)
 {
     global $DB;
     if (strlen($arMessage['module_id']) <= 0 || strlen($arMessage['command']) <= 0) {
         return false;
     }
     $arData = array('module_id' => $arMessage['module_id'], 'command' => $arMessage['command'], 'params' => is_array($arMessage['params']) ? $arMessage['params'] : array());
     if (CPullOptions::GetNginxStatus()) {
         $CHTTP = new CHTTP();
         $CHTTP->http_timeout = 10;
         if ($CHTTP->HTTPQuery('POST', CPullOptions::GetPublishUrl($channelId), str_replace("\n", " ", CUtil::PhpToJsObject(array('CHANNEL_ID' => $channelId, 'MESSAGE' => array($arData), 'ERROR' => ''))))) {
             $result = $CHTTP->result;
         }
     } else {
         $arParams = array('CHANNEL_ID' => $channelId, 'MESSAGE' => str_replace("\n", " ", serialize($arData)), '~DATE_CREATE' => $DB->CurrentTimeFunction());
         $id = IntVal($DB->Add("b_pull_stack", $arParams, array("MESSAGE")));
         $result = $id ? '{"channel": "' . $channelId . '", "id": "' . $id . '"}' : false;
     }
     if (isset($arMessage['push_text']) && strlen($arMessage['push_text']) > 0 && isset($arMessage['push_user']) && intval($arMessage['push_user']) > 0) {
         $CPushManager = new CPushManager();
         $CPushManager->AddQueue(array('USER_ID' => $arMessage['push_user'], 'MESSAGE' => str_replace("\n", " ", $arMessage['push_text']), 'PARAMS' => $arMessage['push_params'], 'TAG' => isset($arMessage['push_tag']) ? $arMessage['push_tag'] : ''));
     }
     return $result;
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:24,代码来源:pull_stack.php


示例19: getActionURL

 /**
  * Returns URL to update policy
  *
  * @param array[string]string $arParams
  * @return string
  *
  */
 protected function getActionURL($arParams = array())
 {
     $arErrors = array();
     $domainTmp = CBXPunycode::ToASCII($this->domain, $arErrors);
     if (strlen($domainTmp) > 0) {
         $domain = $domainTmp;
     } else {
         $domain = $this->domain;
     }
     $arParams["license"] = md5(LICENSE_KEY);
     $arParams["domain"] = $domain;
     $url = COption::GetOptionString("bitrixcloud", "cdn_policy_url");
     $url = CHTTP::urlAddParams($url, $arParams, array("encode" => true));
     return $url;
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:22,代码来源:cdn_webservice.php


示例20: hrefHtml

function hrefHtml()
{
    $result = '';
    $params = array();
    $key = '';
    $argNum = func_num_args();
    for ($i = 0; $i < $argNum; $i++) {
        if ($i == 0) {
            $result = func_get_arg($i);
        } elseif ($i % 2) {
            $key = func_get_arg($i);
        } else {
            $params[$key] = func_get_arg($i);
        }
    }
    $result = CHTTP::urlAddParams($result, $params, array("encode" => true));
    return htmlspecialcharsbx($result);
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:18,代码来源:stat_list.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP CHtml类代码示例发布时间:2022-05-23
下一篇:
PHP CGroups类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap