Merging fixes and enhancements into trunk.

Revision: [2046]
One last refactoring of Dispatcher

git-svn-id: https://svn.cakephp.org/repo/trunk/cake@2047 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2006-02-19 06:26:05 +00:00
parent 528d0e837f
commit 9be62bcb7e
2 changed files with 13 additions and 5 deletions

View file

@ -6,4 +6,4 @@
// +---------------------------------------------------------------------------------------------------+ //
///////////////////////////////////////////////////////////////////////////////////////////////////////////
0.10.8.2045
0.10.8.2047

View file

@ -345,7 +345,7 @@ class Dispatcher extends Object
*
* @return string Base URL
*/
function baseUrl()
function baseUrl()
{
$htaccess = null;
$base = $this->admin;
@ -373,13 +373,21 @@ function baseUrl()
{
if (defined('BASE_URL'))
{
$webroot =setUri();
$webroot = setUri();
$htaccess = preg_replace('/(?:'.APP_DIR.'(.*)|index\\.php(.*))/i', '', $webroot).APP_DIR.'/'.WEBROOT_DIR.'/';
}
if (preg_match('/^(.*)\\/'.APP_DIR.'\\/'.WEBROOT_DIR.'\\/index\\.php$/', $scriptName, $regs))
{
!empty($htaccess)? $this->webroot = $htaccess : $this->webroot = $regs[1].'/'.APP_DIR.'/';
return $base.$regs[1].'/'.APP_DIR;
if(APP_DIR === 'app')
{
$appDir = null;
}
else
{
$appDir = '/'.APP_DIR;
}
!empty($htaccess)? $this->webroot = $htaccess : $this->webroot = $regs[1].$appDir.'/';
return $base.$regs[1].$appDir;
}
elseif (preg_match('/^(.*)\\/'.WEBROOT_DIR.'([^\/i]*)|index\\\.php$/', $scriptName, $regs))
{