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


PHP Http::toString方法代码示例

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


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

示例1: getUri

 /**
  * Return the URI for this header
  *
  * @return string
  */
 public function getUri()
 {
     if ($this->uri instanceof HttpUri) {
         return $this->uri->toString();
     }
     return $this->uri;
 }
开发者ID:robertodormepoco,项目名称:zf2,代码行数:12,代码来源:AbstractLocation.php

示例2: setUri

 /**
  * @param string $uri
  *
  * @return ImageUri
  */
 public function setUri($uri)
 {
     $this->uri = new Http($uri);
     if (!$this->uri->isAbsolute()) {
         throw new \InvalidArgumentException('Invalid image URL: ' . $this->uri->toString());
     }
     return $this;
 }
开发者ID:danielcosta,项目名称:sellercenter-sdk,代码行数:13,代码来源:ImageUri.php

示例3: buildUrl

 protected function buildUrl($url)
 {
     if (!$this->apiKey) {
         throw new MissingAPIKeyException('Missing the API key.  Please either call setApiKey(), set the API key as a dependency parameter, or create a Magium/Mail/GeneratorConfiguration.php file to set the API key');
     }
     $uri = new Http($url);
     $uri->setQuery(['key' => $this->apiKey]);
     return $uri->toString();
 }
开发者ID:magium,项目名称:MagiumMail,代码行数:9,代码来源:Configuration.php

示例4: testGetPortDoesntModifyUrlHttps

 public function testGetPortDoesntModifyUrlHttps()
 {
     $origUri = 'https://www.example.com/foo';
     $uri = new HttpUri($origUri);
     $uri->getPort();
     $this->assertEquals($origUri, $uri->toString());
 }
开发者ID:benivaldo,项目名称:zf2-na-pratica,代码行数:7,代码来源:HttpTest.php

示例5: testNormalizationRemovesPort

 /**
  * Test that normalizing an HTTP URL removes the port depending on scheme
  *
  * @param string $orig
  * @param string $expected
  * @dataProvider portNormalizationTestsProvider
  */
 public function testNormalizationRemovesPort($orig, $expected)
 {
     $uri = new HttpUri($orig);
     $uri->normalize();
     $this->assertEquals($expected, $uri->toString());
 }
开发者ID:ruflin,项目名称:zf2,代码行数:13,代码来源:HttpTest.php

示例6: partiallyRequest

 /**
  * @param Http $httpUri
  * @param int $offset
  * @param int $limit
  * @return array
  */
 protected function partiallyRequest(Http $httpUri, $offset, $limit)
 {
     $query = $httpUri->getQueryAsArray();
     $query['start'] = $offset;
     $query['count'] = $limit;
     $httpUri->setQuery($query);
     $elements = $this->mapper->fetchAll($httpUri->toString());
     $entityName = $this->classMetadata->getName();
     $entities = array();
     foreach ($elements as $element) {
         $hydrator = new EntityHydrator($this->classMetadata);
         $entities[] = $hydrator->hydrate($element, new $entityName());
     }
     return $entities;
 }
开发者ID:spalax,项目名称:zf2-client-moysklad,代码行数:21,代码来源:BasicEntityPersister.php


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