Подключение фреймворка
Joomla 2, 3
if(empty($_SERVER['HTTP_HOST'])) $_SERVER['HTTP_HOST'] = 'mydomain.com';
if(strpos($_SERVER['SCRIPT_NAME'], 'index.php') === false) $_SERVER['SCRIPT_NAME'] = '/'.basename($_SERVER['SCRIPT_NAME']);
$_SERVER['REQUEST_URI'] = '/';
define('_JEXEC', 1);
define('DS', '/');
define('JPATH_BASE', dirname(__DIR__));
if(file_exists(JPATH_BASE.'/defines.php')) include_once JPATH_BASE.'/defines.php';
if(!defined('_JDEFINES')) include_once JPATH_BASE.'/includes/defines.php';
Joomla 4
$_SERVER['REQUEST_URI'] = '/';
if(empty($_SERVER['HTTP_HOST'])) $_SERVER['HTTP_HOST'] = 'xn--b1ageonfb6e.xn--p1ai';
if(strpos($_SERVER['SCRIPT_NAME'], 'index.php') === false) $_SERVER['SCRIPT_NAME'] = '/'.basename($_SERVER['SCRIPT_NAME']);
define('_JEXEC', 1);
require_once dirname(__DIR__).'/includes/console.php';
require_once JPATH_SITE.'/tools/classes/class.parsef.php';
Вызвать обработчик плагина
JPluginHelper::importPlugin('system', 'customrouter');
$resp = $app->triggerEvent('onSendLog', array($text));
Всякое прочее
$app = JFactory::getApplication('site');
$db = JFactory::getDbo();