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


PHP Url::getScheme方法代碼示例

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


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

示例1: getIssueUris

 /**
  * Gets an array of issue uri's from an d.o project issue page(s). Will use
  * the pager to determine when all the issues have been scraped.
  *
  * @return array
  *   An array of d.o issue uris.
  */
 public function getIssueUris()
 {
     if (empty($this->issueUris)) {
         while ($page = $this->getPage()) {
             $issues = $page->filter('table.project-issue td.views-field-title a');
             foreach ($issues as $issue) {
                 $this->issueUris[] = $this->uri->getScheme() . '://' . $this->uri->getHost() . $issue->getAttribute('href');
             }
         }
     }
     return $this->issueUris;
 }
開發者ID:joelpittet,項目名稱:dopatchutils,代碼行數:19,代碼來源:RtbcQueue.php

示例2: validateUrl

 private function validateUrl(Url $url)
 {
     // The host must match the following pattern
     $hostPattern = '/^sns\\.[a-zA-Z0-9\\-]{3,}\\.amazonaws\\.com(\\.cn)?$/';
     if ($url->getScheme() !== 'https' || substr($url, -4) !== '.pem' || !preg_match($hostPattern, $url->getHost())) {
         throw new CertificateFromUnrecognizedSourceException();
     }
 }
開發者ID:risyasin,項目名稱:webpagetest,代碼行數:8,代碼來源:MessageValidator.php

示例3: baseString

 /**
  * Generate a base string for a HMAC-SHA1 signature
  * based on the given a url, method, and any parameters.
  *
  * @param Url    $url
  * @param string $method
  * @param array  $parameters
  *
  * @return string
  */
 protected function baseString(Url $url, $method = 'POST', array $parameters = array())
 {
     $baseString = rawurlencode($method) . '&';
     $schemeHostPath = Url::buildUrl(array('scheme' => $url->getScheme(), 'host' => $url->getHost(), 'path' => $url->getPath()));
     $baseString .= rawurlencode($schemeHostPath) . '&';
     $data = array();
     parse_str($url->getQuery(), $query);
     foreach (array_merge($query, $parameters) as $key => $value) {
         $data[rawurlencode($key)] = rawurlencode($value);
     }
     ksort($data);
     array_walk($data, function (&$value, $key) {
         $value = $key . '=' . $value;
     });
     $baseString .= rawurlencode(implode('&', $data));
     return $baseString;
 }
開發者ID:08euccs014,項目名稱:TrueAnalytics,代碼行數:27,代碼來源:HmacSha1Signature.php

示例4: baseString

 /**
  * Generate a base string for a HMAC-SHA1 signature
  * based on the given a url, method, and any parameters.
  *
  * @param Url    $url
  * @param string $method
  * @param array  $parameters
  *
  * @return string
  */
 protected function baseString(Url $url, $method = 'POST', array $parameters = array())
 {
     $baseString = rawurlencode($method) . '&';
     $schemeHostPath = Url::buildUrl(array('scheme' => $url->getScheme(), 'host' => $url->getHost(), 'path' => $url->getPath()));
     $baseString .= rawurlencode($schemeHostPath) . '&';
     $data = array();
     parse_str($url->getQuery(), $query);
     $data = array_merge($query, $parameters);
     // normalize data key/values
     array_walk_recursive($data, function (&$key, &$value) {
         $key = rawurlencode(rawurldecode($key));
         $value = rawurlencode(rawurldecode($value));
     });
     ksort($data);
     $baseString .= $this->queryStringFromData($data);
     return $baseString;
 }
開發者ID:jtsternberg,項目名稱:oauth1-client,代碼行數:27,代碼來源:HmacSha1Signature.php

示例5: validateUrl

 private function validateUrl(Url $url)
 {
     if ($url->getScheme() !== 'https' || substr($url, -4) !== '.pem' || !preg_match($this->hostPattern, $url->getHost())) {
         throw new CertificateFromUnrecognizedSourceException();
     }
 }
開發者ID:syntropysoftware,項目名稱:cryptoffice-frontend,代碼行數:6,代碼來源:MessageValidator.php


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