Hi, I have several web sites on a shared server. I'm developing a cron job that will send email reminders out when they are scheduled based on data in the database maintained by the specific site.
I have the php script working, except that it is using the Joomla installed for the top-most site. All of the rest of the sites are located is sub-folders of the main site, and each has Joomla installed.
When I run the script, it signs into the db as the user for the topmost site. Is there a way when I instantiate Joomla that I can specify which installation to use? It should be a relative path to the "home" directory, right?
Here's the code I'm using that "loads" Joomla:
/* Initialize Joomla framework */
define( '_JEXEC', 1 );
define('JPATH_BASE', str_replace('/cron','',dirname(__FILE__)) );
define( 'DS', DIRECTORY_SEPARATOR );
/* Required Files */
require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' );
require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' );
require_once ( JPATH_BASE.DS.'libraries'.DS.'joomla'.DS.'environment'.DS.'request.php');
Should I change the define for JPATH_BASE to a relative path?