Windows XP SP3
Apache 2.2 (mod_rewrite is enabled)
PHP 5.2
CakePHP 1.2.2

I've moved the cake directory outside of the application folder, my
htdocs structure is as follows:

/htdocs
    /production
        /cakeApp
            /app
            index.php
            .htaccess
    /staging
        ...
    /development
        ...
    /frameworks
        /cake_1.2.2
            /cake
            /vendors

where ... represents the same structure as production.

I have the main DocumentRoot pointing to the production directory,
then I have two virtual hosts (based on the port used: 8008 for
staging; 8080 for development) that point to the staging and
development directories.

Everything seems to be working fine except when I try and define
CAKE_CORE_DIRECTORY in the top index.php file. My configuration looks
like this:

...
// Custom variables used to define which version of the CakePHP
framework to reference
// trying to define .../htdocs/frameworks/
define('FRAMEWORKS_ROOT', $_SERVER['DOCUMENT_ROOT'] . DS . '..' . DS .
'frameworks' . DS);
define('CAKE_VERSION', '1.2.2');

if (!defined('CAKE_CORE_INCLUDE_PATH')) {
    // trying to define .../htdocs/frameworks/cake_1.2.2
    define('CAKE_CORE_INCLUDE_PATH', FRAMEWORKS_ROOT . 'cake_' .
CAKE_VERSION);
}
...

However it seems that when processing gets to the /app/webroot/
index.php file, the CAKE_CORE_INCLUDE_PATH is undefined (assigns it
the default ROOT as per the if statement in the file).

I can get it everything working if I change the /app/webroot/index.php
file like this:

if (!defined('CAKE_CORE_INCLUDE_PATH')) {
    define('FRAMEWORKS_ROOT', $_SERVER['DOCUMENT_ROOT'] . DS . '..' .
DS . 'frameworks' . DS);
    define('CAKE_VERSION', '1.2.2');
    define('CAKE_CORE_INCLUDE_PATH', FRAMEWORKS_ROOT . 'cake_' .
CAKE_VERSION);
}

but that seems messy and redundant as it should be doing all this in
the top index.php file.

Any help on a more elegant solution would be greatly appreciated!

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to