Hi,Matthew
you just corrected the *$count($segs)* bug.And the bug with the methods
of Zend_Http_Request hasn't corrected yet.
* /**
* Base URL of request
* @var string
*/
protected $_baseUrl = ''; *
* /**
* Base path of request
* @var string
*/
protected $_basePath = ''; *
* /**
* PATH_INFO
* @var string
*/
protected $_pathInfo = '';*
these attributes initial value is an empty string.And the methods following
to compare these attributes with *null . *the condition statement *if
($this->_baseUrl === null)* equal to *if ('' === null)* always get
false.Soshould corrected the condition statement with
*if ($this->_baseUrl === '')* statement or corrected the attribute *
$_baseUrl* initial value '' with *null. (protected $_baseUrl;)*
*/**
* Everything in REQUEST_URI before PATH_INFO
* <form action="<?=$baseUrl?>/news/submit" method="POST"/>
*
* @return string
*/
public function getBaseUrl()
{
if ($this->_baseUrl === null) {
$this->setBaseUrl();
}
return $this->_baseUrl;
} *
**
* /**
* Everything in REQUEST_URI before PATH_INFO not including the filename
* <img src="<?=$basePath?>/images/zend.png"/>
*
* @return string
*/
public function getBasePath()
{
if ($this->_basePath === null) {
$this->setBasePath();
}
return $this->_basePath;
} *
**
* /**
* Returns everything between the BaseUrl and QueryString.
* This value is calculated instead of reading PATH_INFO
* directly from $_SERVER due to cross-platform differences.
*
* @return string
*/
public function getPathInfo()
{
if ($this->_pathInfo === null) {
$this->setPathInfo();
}
return $this->_pathInfo;
}
*
sorry for my englist again.
2006/11/19, Matthew Weier O'Phinney <[EMAIL PROTECTED]>:
-- ?????? <[EMAIL PROTECTED]> wrote
(on Saturday, 18 November 2006, 10:10 AM +0800):
> In Zend_Http_Request code line 337 , $count($segs) should be
count($segs).
> And the attributes $_baseUrl,$_basePath and $_pathInfo initial value is
''. But
> the method getBaseUrl(),getBasePath() and getPathInfo() detect the
attributes
> link this :if ($this->_baseUrl === null) , if ($this->_basePath ===
null) and
> if ($this->_pathInfo === null) .
> So when invoke method of these,just return ''.
Corrected in subversion; please test!
--
Matthew Weier O'Phinney
PHP Developer | [EMAIL PROTECTED]
Zend - The PHP Company | http://www.zend.com/