Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sarfraznawaz2005/0b5ddc65a56d4c6f19e9 to your computer and use it in GitHub Desktop.
Save sarfraznawaz2005/0b5ddc65a56d4c6f19e9 to your computer and use it in GitHub Desktop.
Accessing Joomla Framework Outside of Joomla
<?php
// include the following at the top of your script
define( '_JEXEC', 1 );
define('JPATH_BASE', dirname(dirname(__FILE__)));
define( 'DS', DIRECTORY_SEPARATOR );
require_once (JPATH_BASE . DS . 'includes' . DS . 'defines.php');
require_once (JPATH_BASE . DS . 'includes' . DS . 'framework.php');
$mainframe = JFactory::getApplication('site');
//From there you can do normal development as if you were inside of Joomla's framework
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment