Created
March 24, 2017 16:17
-
-
Save webmechanicx/b267baeb508f498fa6dc9823cb8d074c to your computer and use it in GitHub Desktop.
Load the Joomla! Framework in a PHP Script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
define( '_JEXEC', 1 ); | |
// JPATH_BASE should point to Joomla!'s root directory | |
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(); | |
$user =& JFactory::getUser(); | |
// display user object | |
print_r($user); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment