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


PHP Url::setPath方法代码示例

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


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

示例1: buildRequestUrl

 /**
  * @param Actions\ActionsInterface $action
  * @param array                    $requestParams
  * @return Url
  */
 protected function buildRequestUrl(Actions\ActionsInterface $action, array $requestParams)
 {
     $url = new Url('https', $this->connection->getEndpoint());
     $url->setPath($action->getAction());
     $url->setQuery($requestParams);
     return $url;
 }
开发者ID:jdecoster,项目名称:SlackBundle,代码行数:12,代码来源:Client.php

示例2: getCloudFrontUrl

 /**
  * Get a CloudFront URL for an S3 key.
  *
  * @param $key
  *   The S3 object key.
  * @param int $expiry
  *   (optional) Expiry time for the URL, as a Unix timestamp.
  * @return \Guzzle\Http\Url
  *   The CloudFront URL.
  */
 protected function getCloudFrontUrl($key, $expiry = NULL)
 {
     // Real CloudFront credentials are required to test this, so we ignore
     // testing this.
     // @codeCoverageIgnoreStart
     $cf = $this->config->getCloudFront();
     $url = new Url('https', $this->config->getDomain());
     $url->setPath($key);
     $this->injectCname($url);
     $options = array('url' => (string) $url, 'expires' => $expiry);
     $url = Url::factory($cf->getSignedUrl($options));
     return $url;
     // @codeCoverageIgnoreEnd
 }
开发者ID:vuhoanglinh2002,项目名称:drupal,代码行数:24,代码来源:StreamWrapper.php

示例3: getEndpoint

 /**
  * The endpoint varies depending on developer mode, and whether the method is GET or POST.
  * If the method is GET, then the data needs to be added to the URL here. I've not found any
  * helper functions to construct URLs in omnipay, but they could be there.
  * It may also be possible to leave the URL construction to Guzzle, assuming Guzzle is able
  * to add an arbitrary list of query parameters to the endpoint that may already have some
  * query parameters.
  * CHECKME: it seems that Guzzle will accept an array containing a template and substitution
  * variables for its endpoint. This would avoid us needing to construct it here.
  */
 public function getEndpoint()
 {
     $domain = $this->getDeveloperMode() ? $this->endpointDevDomain : $this->endpointProdDomain;
     $path = $this->getPath();
     // Build the URL from the parts.
     // There is a dependency on Guzzle here, which OmniPay uses, but may be a
     // bit of an assumption in the longer term.
     $url = new Url($this->endpointScheme, $domain);
     $url->setPath($path);
     if ($this->getMethod() == 'GET') {
         $url->setQuery($this->getData());
     }
     return $url;
 }
开发者ID:academe,项目名称:omnipay-helcim,代码行数:24,代码来源:AbstractRequest.php


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