Carregando o framework do Joomla a partir de um script PHP
|
Categoria: Joomla
|
Publicado em 24 de Setembro de 2010
|
Para carregar o framework do Joomla a partir de qualquer script PHP:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
<?php
define( '_JEXEC', 1 );
define( '_VALID_MOS', 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();
$session =& JFactory::getSession();
// Seu código vai aqui
?>
|
<?php define( '_JEXEC', 1 ); define( '_VALID_MOS', 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(); $session =& JFactory::getSession(); ?>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
<?php
define( '_JEXEC', 1 );
define( '_VALID_MOS', 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();
$session =& JFactory::getSession();
// Seu código vai aqui
?>
|
|