Hello,

Thanks you 'gwoo' for your answer ;-)
I have found a temporary solution to my special case.

In fact, I think that the following situation is not supported by
CakePHP for now :
   1. Having "WEBROOT_DIR" outside "APP_DIR"
   2. Having mod_rewrite disabled
   3. Having define ('BASE_URL', env('SCRIPT_NAME')); activated in
app/core.php

I have tried to debug a little bit in Dispatcher::baseUrl() and it
appears that around line 375 you have this code :

/cake/dispatcher.php (~ line 375)
-----------------------------------------------------------------------

    if (defined('BASE_URL')) {
         $webroot = setUri();
         $htaccess = preg_replace('/(?:'.APP_DIR.'(.*)|index\\.php(.*))/i',
'', $webroot).APP_DIR.'/'.WEBROOT_DIR.'/';
    ....
    (20 lines)
    ....
    !empty($htaccess)? $this->webroot = $htaccess : $this->webroot =
'/';

-----------------------------------------------------------------------

As a consequence, you can't have a webroot like "/www/" .. but you will
always kept a webroot like "/app/www".

So, my solution was to remove APP_DIR from the '$htaccess" like this :

-----------------------------------------------------------------------

       $htaccess =
preg_replace('/(?:'.APP_DIR.'(.*)|index\\.php(.*))/i', '',
$webroot).WEBROOT_DIR.'/';

-----------------------------------------------------------------------

In addition, the ROOT/index.php had to be changed to remove APP_DIR
from

       require APP_DIR . DS . WEBROOT_DIR . DS . 'index.php5';

Of course, this solution only solves this specific problem. It is not a
fix to support any situation because if you finally put "webroot" into
"app" .. the problem still exists :'(

Maybe, a solution would be to add a "define" WEBROOT_PATH to indicate
the whole path to the WEBROOT_DIR. Then, the common situation would be
:

       define('WEBROOT_PATH',   APP_DIR.'/'.WEBROOT_DIR)

and my situation would be supported :

       define('WEBROOT_PATH',   WEBROOT_DIR)

What do you think ?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---

Reply via email to