Skip to content

Instantly share code, notes, and snippets.

@CB9TOIIIA
Last active August 2, 2017 10:19
Show Gist options
  • Save CB9TOIIIA/88fa1f0b1265161c87d0515add62effb to your computer and use it in GitHub Desktop.
Save CB9TOIIIA/88fa1f0b1265161c87d0515add62effb to your computer and use it in GitHub Desktop.
How to load the Joomla API
define('_JEXEC', 1);
define('DS', DIRECTORY_SEPARATOR);
if (file_exists(dirname(__FILE__) . '/defines.php')) {
include_once dirname(__FILE__) . '/defines.php';
}
if (!defined('_JDEFINES')) {
define('JPATH_BASE', dirname(__FILE__));
require_once JPATH_BASE.'/includes/defines.php';
}
require_once JPATH_BASE.'/includes/framework.php';
$app = JFactory::getApplication('site');
JBZoo::init();
JFactory::getApplication('site')->initialise();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment