Подключение фреймворка Joomla

Joomla! 4

  define('_JEXEC', 1);
  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']);
  require_once dirname(__DIR__).'/includes/console.php';

 

Joomla! 3 и ниже

  define('_JEXEC', 1);
  if(strpos($_SERVER['SCRIPT_NAME'], 'index.php') === false) $_SERVER['SCRIPT_NAME'] = '/'.basename($_SERVER['SCRIPT_NAME']);
  define('DS', '/');
  define('JPATH_BASE', realpath(dirname(__FILE__)."/.."));
  require_once(JPATH_BASE."/includes/defines.php");
  require_once(JPATH_SITE."/includes/framework.php");

  // Вызвать обработчик плагина:
  JPluginHelper::importPlugin('system', 'infobot');
  $resp = $app->triggerEvent('onSendLog', array($text));