I have a PHP script that is to be run indirectly by cron daemon through the web server. I’m confused about where to place this file in the CakePHP folder structure.
Should I place it in any controller and give it access from outside? (i.e without login check)
Or is it better to place this script outside my cake project folder and put it anywhere in localhost?
If the script does not utilize CakePHP goodness (pure PHP) just place it in a directory not accessible to the public, for example ‘Cron’ on same level as ‘App’.
If it does use CakePHP, place it as an action in the appropriate controller. You can add a custom prefix to the action e.g. ‘cron’, then override AppController and if the prefix is ‘cron’, check the IP address. Deny access if it isn’t localhost.