J1.5

Initializing the Joomla! 1.5 Framework in an external script

From Joomla! Documentation

The "J1.5" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.

Joomla 1.5

Requests that should be handled by Joomla! should be issued to the index.php file in the main folder of your Joomla! installation. This will ensure that the Joomla! environment is loaded correctly.

In some exceptional cases, it might be necessary to load the Joomla! Framework separately. This is mainly useful when you want the Framework to be loaded from an external script, without launching the Site application. You can use the following code to do so:

/* Initialize Joomla framework */
define( '_JEXEC', 1 );
define('JPATH_BASE', 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' );
/* To use Joomla's Database Class */
require_once ( JPATH_BASE .DS.'libraries'.DS.'joomla'.DS.'factory.php' );
/**************************************************/
// Your code starts here...
// Remember that the Site application isn't running, so you cannot access $mainframe or any of its methods.
/**************************************************/