Hello,
I've run into a consistency issue with Zend_Controller_Request_Http (ZF 1.8.4). The constructor accepts a request uri, and there's also a setRequestUri method. I assumed the following two snippets of code would produce the same results:
// This works
$request = new Zend_Controller_Request_Http('http://www.example.com/foo/bar');
// This doesn't work
$request = new Zend_Controller_Request_Http();
$request->setRequestUri('http://www.example.com/foo/bar');
The constructor passes the string to Zend_Uri::factory(), validates the URI, joins the path and query with a question mark, and then passes the resulting string to setRequestUri().
setRequestUri() simply copies the string argument to the protected property $_requestUri (after extracting the query portion, if any).
It seems to me that these two implementations should be compatible. Or better yet, the constructor should proxy directly to setRequestUri() without doing any fancy work (let setRequestUri handle that).
Am I missing something or should I submit a bug report and a patch? Thanks!
--
Hector
--
Hector
没有评论:
发表评论