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


PHP HttpClient::addQuery方法代码示例

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


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

示例1: _remoteCall

 protected function _remoteCall($method, $params = null)
 {
     $uri = $this->reportServer;
     $cache_id = md5($this->objectName . $uri . $method . serialize($params));
     $cacheSvc = Openbiz::getService(CACHE_SERVICE, 1);
     $cacheSvc->init($this->objectName, $this->cacheLifeTime);
     if (substr($uri, strlen($uri) - 1, 1) != '/') {
         $uri .= '/';
     }
     $uri .= "ws.php/udc/CollectService";
     if ($cacheSvc->test($cache_id) && (int) $this->cacheLifeTime > 0) {
         $resultSetArray = $cacheSvc->load($cache_id);
     } else {
         try {
             $argsJson = urlencode(json_encode($params));
             $query = array("method={$method}", "format=json", "argsJson={$argsJson}");
             $httpClient = new HttpClient('POST');
             foreach ($query as $q) {
                 $httpClient->addQuery($q);
             }
             $headerList = array();
             $out = $httpClient->fetchContents($uri, $headerList);
             $cats = json_decode($out, true);
             $resultSetArray = $cats['data'];
             $cacheSvc->save($resultSetArray, $cache_id);
         } catch (Exception $e) {
             $resultSetArray = array();
         }
     }
     return $resultSetArray;
 }
开发者ID:openbizx,项目名称:openbizx-cubix,代码行数:31,代码来源:ErrorReportService.php

示例2: testSvc

function testSvc($url, $query = null, $cookie = null)
{
    $httpClient = new HttpClient('POST');
    $httpClient->setCookie($cookie);
    foreach ($query as $q) {
        $httpClient->addQuery($q);
    }
    $headerList = array();
    $out = $httpClient->fetchContents($url, $headerList, false);
    return $out;
}
开发者ID:Why-Not-Sky,项目名称:cubi-ng,代码行数:11,代码来源:pkg_test.php

示例3: acquireLicense

 public function acquireLicense($activationCode, $contactEmail, $serverData)
 {
     //try to process cache service.
     $argsJson = json_encode(array("activation_code" => $activationCode, "contact_email" => $contactEmail, "server_data" => $serverData));
     $query = array("method=acquireLicense", "format=json", "argsJson={$argsJson}");
     $httpClient = new HttpClient('POST');
     foreach ($query as $q) {
         $httpClient->addQuery($q);
     }
     $headerList = array();
     $out = $httpClient->fetchContents($this->repositoryUrl, $headerList);
     echo $out;
     $lic = json_decode($out, true);
     $licenseArray = $lic['data'];
     return $licenseArray;
 }
开发者ID:openbizx,项目名称:openbizx-cubix,代码行数:16,代码来源:licenseClient.php

示例4: GetSystemUUIDfromRemote

 public function GetSystemUUIDfromRemote()
 {
     $method = "CetSystemUUID";
     if (function_exists("ioncube_server_data")) {
         $system_server_data = ioncube_server_data();
     } else {
         $system_server_data = "";
     }
     $params = array("system_server_data" => $system_server_data);
     $argsJson = urlencode(json_encode($params));
     $query = array("method={$method}", "format=json", "argsJson={$argsJson}");
     $httpClient = new HttpClient('POST');
     foreach ($query as $q) {
         $httpClient->addQuery($q);
     }
     $headerList = array();
     $out = $httpClient->fetchContents($this->m_UDC_Server, $headerList);
     $cats = json_decode($out, true);
     $result = $cats['data'];
     if ($result) {
         $dataFile = APP_HOME . '/files/system_uuid.data';
         file_put_contents($dataFile, $result);
     }
     return $result;
 }
开发者ID:Why-Not-Sky,项目名称:cubi-ng,代码行数:25,代码来源:CubiService.php


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