Skip to content

Instantly share code, notes, and snippets.

@danyj
Created February 10, 2018 11:38
Show Gist options
  • Save danyj/1c719e347d0d710667111705c32ac2ff to your computer and use it in GitHub Desktop.
Save danyj/1c719e347d0d710667111705c32ac2ff to your computer and use it in GitHub Desktop.
External Joomla
<?php
//define('_JREQUEST_NO_CLEAN', 1);
define( '_JEXEC', 1 );
define( 'DS', DIRECTORY_SEPARATOR );
define('JPATH_BASE',str_replace(basename(dirname(__FILE__)),"",dirname(__FILE__)));
require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' );
require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' );
jimport( 'joomla.filesystem.file');
jimport( 'joomla.filesystem.folder' );
jimport( 'joomla.methods' );
jimport( 'joomla.session.session' );
jimport( 'joomla.user.user');
jimport( 'joomla.html.html.access' );
jimport( 'joomla.application.module.helper' );
jimport( 'joomla.application.component.helper' );
$app = JFactory::getApplication('site');
$lang = JFactory::getLanguage();
$document = JFactory::getDocument();
$session = JFactory::getSession();
$user = JFactory::getUser();
$app->initialise();
JPluginHelper::importPlugin('system');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment