Skip to content

Instantly share code, notes, and snippets.

@rajvanshipradeep15
Created June 3, 2013 06:36
Show Gist options
  • Save rajvanshipradeep15/5696434 to your computer and use it in GitHub Desktop.
Save rajvanshipradeep15/5696434 to your computer and use it in GitHub Desktop.
joomla: include jfactory class in external php file
Include Jfactory class in external php file
define( '_JEXEC', 1 );
define( 'DS', DIRECTORY_SEPARATOR );
define( 'JPATH_BASE', $_SERVER[ 'DOCUMENT_ROOT' ] );
... then you need to include three files, like:
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 . 'factory.php' );
$mainframe =& JFactory::getApplication('site');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment