On Thu, Jan 3, 2013 at 5:08 PM, masterpuppet <[email protected]> wrote:
> You could pass a Zend\Uri\Http to TreeRouteStack::assemble,
>
> $uri = new \Zend\Uri\Http('http://foo.example.com:8080');
> or
> $uri = new \Zend\Uri\Http('http://foo.example.com');
> $uri->setPort(8080);
>
> $router->assemble(array(), array('name' => 'home', 'uri' => $uri));
> //generates http://foo.example.com:8080/

I think the point Richard is making is that he may be testing on a
system that uses a non-default port (for instance, using PHP 5.4's
built-in web server), and as such the port may not be known. As such,
he's suggesting that if the hostname route is in use, it may need to
check to see if the port + schema combination is standard, and, if
not, also provide the port.

Richard, does that sum up the concern for you? If so, I think we
should re-open the issue.

> 2013/1/3 richard [via Zend Framework Community] <
> [email protected]>
>> I have recently stumbled across a requirement to generate urls with non
>> standard ports using zf2 Treestack Router.
>>
>> For example, I might want to generate the URL
>> http://foo.example.com:8080/index from http://bah.example.com/lalaland
>>
>> I have submitted a pull request (that was very quickly closed) here:
>> https://github.com/zendframework/zf2/pull/3338
>>
>> I am of the opinion that whilst foo.example.com:8080 is not a valid
>> hostname, it is a valid uri, with hostname foo.example.com and port 8080.
>>
>> Is it possible to configure the router to generate
>> http://foo.example.com:8080/index from http://bah.example.com/lalaland 
>> without
>> changing the library codebase?



--
Matthew Weier O'Phinney
Project Lead            | [email protected]
Zend Framework          | http://framework.zend.com/
PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc

-- 
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]


Reply via email to