当前位置: 首页>>代码示例>>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;未经允许,请勿转载。