當前位置: 首頁>>代碼示例>>PHP>>正文


PHP PagSeguroLibrary::getCMSVersion方法代碼示例

本文整理匯總了PHP中PagSeguroLibrary::getCMSVersion方法的典型用法代碼示例。如果您正苦於以下問題:PHP PagSeguroLibrary::getCMSVersion方法的具體用法?PHP PagSeguroLibrary::getCMSVersion怎麽用?PHP PagSeguroLibrary::getCMSVersion使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PagSeguroLibrary的用法示例。


在下文中一共展示了PagSeguroLibrary::getCMSVersion方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: curlConnection

 private function curlConnection($method, $url, $timeout, $charset, array $data = null)
 {
     if (Tools::strtoupper($method) === 'POST') {
         $postFields = $data ? http_build_query($data, '', '&') : "";
         $contentLength = "Content-length: " . Tools::strlen($postFields);
         $methodOptions = array(CURLOPT_POST => true, CURLOPT_POSTFIELDS => $postFields);
     } else {
         $contentLength = null;
         $methodOptions = array(CURLOPT_HTTPGET => true);
     }
     $options = array(CURLOPT_HTTPHEADER => array("Content-Type: application/x-www-form-urlencoded; charset=" . $charset, $contentLength, 'lib-description: php:' . PagSeguroLibrary::getVersion(), 'language-engine-description: php:' . PagSeguroLibrary::getPHPVersion()), CURLOPT_URL => $url, CURLOPT_RETURNTRANSFER => true, CURLOPT_HEADER => false, CURLOPT_SSL_VERIFYPEER => false, CURLOPT_CONNECTTIMEOUT => $timeout);
     if (!is_null(PagSeguroLibrary::getModuleVersion())) {
         array_push($options[CURLOPT_HTTPHEADER], 'module-description: ' . PagSeguroLibrary::getModuleVersion());
     }
     if (!is_null(PagSeguroLibrary::getCMSVersion())) {
         array_push($options[CURLOPT_HTTPHEADER], 'cms-description: ' . PagSeguroLibrary::getCMSVersion());
     }
     $options = $options + $methodOptions;
     $curl = curl_init();
     curl_setopt_array($curl, $options);
     $resp = curl_exec($curl);
     $info = curl_getinfo($curl);
     $error = curl_errno($curl);
     $errorMessage = curl_error($curl);
     curl_close($curl);
     $this->setStatus((int) $info['http_code']);
     $this->setResponse((string) $resp);
     if ($error) {
         throw new Exception("CURL can't connect: {$errorMessage}");
     } else {
         return true;
     }
 }
開發者ID:kennedimalheiros,項目名稱:prestashop,代碼行數:33,代碼來源:PagSeguroHttpConnection.class.php


注:本文中的PagSeguroLibrary::getCMSVersion方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。