Skip to content

Instantly share code, notes, and snippets.

@0ex-d
Created June 7, 2016 06:21
Show Gist options
  • Save 0ex-d/1da2bc0eaaf2cbc6e1e40e0c3e15f43b to your computer and use it in GitHub Desktop.
Save 0ex-d/1da2bc0eaaf2cbc6e1e40e0c3e15f43b to your computer and use it in GitHub Desktop.
Import Joomla to your MVC for some reasons
<?php
/*
* Swiftly: Import Joomla for some reasons
* N.B: Our 'JPATH_BASE' is not in same dir
* June 05, 2016
*/
if (!defined('_JEXEC')) {
define( '_JEXEC', 1 );
define( 'JPATH_BASE', realpath(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');
$mainframe->initialise();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment