yangruiyou85 / yiidoc

Automatically exported from code.google.com/p/yiidoc
0 stars 0 forks source link

bad controller name generetion #66

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
path: http://testlightideas.com/kisstown/account

getPathInfo method:

    public function getPathInfo()
    {
        if($this->_pathInfo===null)
        {
            $requestUri=$this->getRequestUri();
            $scriptUrl=$this->getScriptUrl();
            $baseUrl=$this->getBaseUrl();
            echo 'requestUri=' . $requestUri . '<br>';
            echo 'scriptUrl=' . $scriptUrl . '<br>';
            echo 'baseUrl=' . $baseUrl . '<br>';
            if(strpos($requestUri,$scriptUrl)===0) {echo 111;
                $pathInfo=substr($requestUri,strlen($scriptUrl));}
            else if($baseUrl==='' || strpos($requestUri,$baseUrl)===0) {echo 222;
                $pathInfo=substr($requestUri,strlen($baseUrl));}
            else if(strpos($_SERVER['PHP_SELF'],$scriptUrl)===0) {echo 333;
                $pathInfo=substr($_SERVER['PHP_SELF'],strlen($scriptUrl));}
            else
                throw new CException(Yii::t('yii','CHttpRequest is unable to determine
the path info of the request.'));

            if(($pos=strpos($pathInfo,'?'))!==false)
                $pathInfo=substr($pathInfo,0,$pos);

            $this->_pathInfo=trim($pathInfo,'/');
        }
        return $this->_pathInfo;
    }

OUTPUT: 

requestUri=/kisstown/account
scriptUrl=/testlightideas/kisstown/index.php
baseUrl=/testlightideas/kisstown
333 

This causes always generating default controller. This bug is only if
'urlformat' is set to 'path'

Original issue reported on code.google.com by iakreve...@gmail.com on 13 Feb 2010 at 10:54

GoogleCodeExporter commented 9 years ago
This issue tracker is for documentation errors only.

Original comment by qiang.xue on 17 Feb 2010 at 9:45