Found the problem.

(Thanks Grant for trying to help)

The bakery article seems to have been modified at some point to
provide a measure of security to prevent the cron from being executed
from the web browser.

I think, originally perhaps, the cron_dispatcher.php may have been
supposed to sit in app/webroot, and only later was the article edited
to instruct people to put the cron in app/ for security (not sure of
this, just guessing, as it seems to explain the problem I was having.
Either that, or the developer's file layout was different than mine)

Anyways, the bakery article says to put the cron_dispatcher.php into
the app/ directory.

Notice - this is one level up in the directory heirarchy from app/
webroot. So, many of the constants defined in the cron_dispatcher are
now off by one level. The result is cake cannot find the app
directory.

Someone posted a redfined APP constant on the bakery article, but it
didn't work for me, because other constants needed to be changed also.

For those interested, here is my full - and working - cron dispatcher,
with the changed constants. This assumes the cron_dispatcher sits in
public_html/app/webroot, with public_html being the server's document
root (note this is a development setup, not a cake production setup)

(boy it sure feels good to be able to pay back once in a while -- :)
===============================================================================

<?php
        if (!defined('DS')) {
                define('DS', DIRECTORY_SEPARATOR);
        }
/**
 * These defines should only be edited if you have cake installed in
 * a directory layout other than the way it is distributed.
 * Each define has a commented line of code that explains what you
would change.
 *
 */
        if (!defined('ROOT')) {
                //define('ROOT', 'FULL PATH TO DIRECTORY WHERE APP DIRECTORY IS
LOCATED DO NOT ADD A TRAILING DIRECTORY SEPARATOR';
                //You should also use the DS define to seperate your directories
                define('ROOT', dirname(dirname(__FILE__)));
        }
        if (!defined('APP_DIR')) {
                //define('APP_DIR', 'DIRECTORY NAME OF APPLICATION';
                define('APP_DIR', basename(dirname(__FILE__)));
        }
/**
 * This only needs to be changed if the cake installed libs are
located
 * outside of the distributed directory structure.
 */
        if (!defined('CAKE_CORE_INCLUDE_PATH')) {
                //define ('CAKE_CORE_INCLUDE_PATH', FULL PATH TO DIRECTORY WHERE
CAKE CORE IS INSTALLED DO NOT ADD A TRAILING DIRECTORY SEPARATOR';
                //You should also use the DS define to seperate your directories
                define('CAKE_CORE_INCLUDE_PATH', ROOT);
        }
///////////////////////////////
//DO NOT EDIT BELOW THIS LINE//
///////////////////////////////
        if (!defined('WEBROOT_DIR')) {
                define('WEBROOT_DIR', 'webroot');
        }
        if (!defined('WWW_ROOT')) {
                //define('WWW_ROOT', dirname(__FILE__) . DS);
                define('WWW_ROOT', dirname(__FILE__) . DS . 'webroot' . DS);
        }
        if (!defined('CORE_PATH')) {
                if (function_exists('ini_set')) {
                        ini_set('include_path', CAKE_CORE_INCLUDE_PATH . 
PATH_SEPARATOR .
ROOT . DS . APP_DIR . DS . PATH_SEPARATOR . ini_get('include_path'));
                        define('APP_PATH', null);
                        define('CORE_PATH', null);
                } else {
                        define('APP_PATH', ROOT . DS . APP_DIR . DS);
                        define('CORE_PATH', CAKE_CORE_INCLUDE_PATH . DS);
                }
        }
        require CORE_PATH . 'cake' . DS . 'bootstrap.php';


        define('CRON_DISPATCHER',true);
        if($argc == 2) {
                $Dispatcher= new Dispatcher();
                $Dispatcher->dispatch($argv[1]);
        }

?>


--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to