本文整理汇总了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;
}
示例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;
}
示例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();
}
示例4: testGetPortDoesntModifyUrlHttps
public function testGetPortDoesntModifyUrlHttps()
{
$origUri = 'https://www.example.com/foo';
$uri = new HttpUri($origUri);
$uri->getPort();
$this->assertEquals($origUri, $uri->toString());
}
示例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());
}
示例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;
}