if (!is_readable($path)) {
throw new \RuntimeException('File not found or not readable');
}
// Try to load the file
$xml = simplexml_load_file($path);
if (!$xml) {
return;
}
}
$result = null;
if (is_file($file)) {
$result = self::parseXMLLanguageFile($file);
}
if (empty($result)) {
return;
}
if ($lang == null) {
$lang = $this->default;
}
$this->lang = $lang;
$this->metadata = LanguageHelper::getMetadata($this->lang);
$this->setDebug($debug);
/*
* Let's load the default override once, so we can profit from that, too
* But make sure, that we don't enforce it on each language file load.
*
* @since 4.0.0
*/
public function createLanguage($lang, $debug = false): Language
{
return new Language($lang, $debug);
}
}
* @since 4.0.0
*/
public function createLanguage($lang, $debug = false): Language
{
if (!isset(self::$languages[$lang . $debug])) {
self::$languages[$lang . $debug] = parent::createLanguage($lang, $debug);
}
return self::$languages[$lang . $debug];
}
}
);
$conf = self::getConfig();
$locale = $conf->get('language');
$debug = $conf->get('debug_lang');
$lang = self::getContainer()->get(LanguageFactoryInterface::class)->createLanguage($locale, $debug);
return $lang;
}
/**
),
E_USER_DEPRECATED
);
if (!self::$language) {
self::$language = self::createLanguage();
}
return self::$language;
}
*/
public function __construct($options = array())
{
// Extract the internal dependencies before calling the parent constructor since it calls $this->load()
$this->app = isset($options['app']) && $options['app'] instanceof CMSApplication ? $options['app'] : Factory::getApplication();
$this->language = isset($options['language']) && $options['language'] instanceof Language ? $options['language'] : Factory::getLanguage();
if (!isset($options['db']) || !($options['db'] instanceof DatabaseDriver)) {
@trigger_error(sprintf('Database will be mandatory in 5.0.'), E_USER_DEPRECATED);
$options['db'] = Factory::getContainer()->get(DatabaseDriver::class);
}
if (!array_key_exists('db', $options)) {
$options['db'] = $this->getDatabase();
}
$instance = new $classname($options);
if ($instance instanceof CacheControllerFactoryAwareInterface) {
$instance->setCacheControllerFactory($this->getCacheControllerFactory());
}
if ($this->menuFactory === null) {
@trigger_error('Menu factory must be set in 5.0', E_USER_DEPRECATED);
$this->menuFactory = $this->getContainer()->get(MenuFactoryInterface::class);
}
$this->menus[$name] = $this->menuFactory->createMenu($name, $options);
// Make sure the abstract menu has the instance too, is needed for BC and will be removed with version 5
AbstractMenu::$instances[$name] = $this->menus[$name];
return $this->menus[$name];
return $this->template->template;
}
// Get the id of the active menu item
$menu = $this->getMenu();
$item = $menu->getActive();
if (!$item) {
$item = $menu->getItem($this->input->getInt('Itemid', null));
}
public function render(\Throwable $error): string
{
$app = Factory::getApplication();
// Get the current template from the application
$template = $app->getTemplate(true);
// Push the error object into the document
$this->getDocument()->setError($error);
// Add registry file for the template asset
// Reset the document object in the factory, this gives us a clean slate and lets everything render properly
Factory::$document = $renderer->getDocument();
Factory::getApplication()->loadDocument(Factory::$document);
$data = $renderer->render($error);
// If nothing was rendered, just use the message from the Exception
if (empty($data)) {
$data = $error->getMessage();
}
* @since 3.10.0
*/
public static function handleException(\Throwable $error)
{
static::logException($error);
static::render($error);
}
/**
* Render the error page based on an exception.
*
);
// Trigger the onError event.
$this->triggerEvent('onError', $event);
ExceptionHandler::handleException($event->getError());
}
// Trigger the onBeforeRespond event.
$this->getDispatcher()->dispatch('onBeforeRespond');
// Set the application as global app
\Joomla\CMS\Factory::$application = $app;
// Execute the application.
$app->execute();
* define() is used rather than "const" to not error for PHP 5.2 and lower
*/
define('_JEXEC', 1);
// Run the application - All executable code should be triggered through this file
require_once dirname(__FILE__) . '/includes/app.php';
}
// Make sure the MySQLi extension for PHP is installed and enabled.
if (!static::isSupported())
{
throw new UnsupportedAdapterException('The MySQLi extension is not available');
}
/*
* Unlike mysql_connect(), mysqli_connect() takes the port and socket as separate arguments. Therefore, we
* have to extract them from the host string.
* @since 2.0.0
*/
#[\ReturnTypeWillChange]
public function open($save_path, $session_id)
{
$this->db->connect();
return true;
}
/**
throw new \RuntimeException(
sprintf('Failed to start the session because headers have already been sent by "%s" at line %d.', $file, $line)
);
}
if (!session_start())
{
throw new \RuntimeException('Failed to start the session');
}
$this->isActive();
$this->setId($session_clean);
$cookie->set($session_name, '', time() - 3600);
}
}
parent::start();
// Try loading data from the session
if (isset($_SESSION['joomla']) && !empty($_SESSION['joomla'])) {
$this->data = unserialize(base64_decode($_SESSION['joomla']));
}
if ($this->isStarted())
{
return;
}
$this->store->start();
$this->setState(SessionState::ACTIVE);
// Initialise the session
$this->setCounter();
*/
public function has($name)
{
if (!$this->isActive())
{
$this->start();
}
return $this->store->has($name);
}
$name = $args[2] . '.' . $name;
}
}
if (parent::has($name)) {
// Parent is used because of b/c, can be changed in Joomla 5
return parent::get($name, $default);
}
/*
__CLASS__
),
E_USER_DEPRECATED
);
$instance = self::getApplication()->getSession()->get('user');
if (\is_null($id)) {
if (!($instance instanceof User)) {
$instance = User::getInstance();
}
*
* @since 3.2
*/
protected function initialiseApp($options = array())
{
$user = Factory::getUser();
// If the user is a guest we populate it with the guest user group.
if ($user->guest) {
$guestUsergroup = ComponentHelper::getParams('com_users')->get('guest_usergroup', 1);
$user->groups = array($guestUsergroup);
* @since 3.2
*/
protected function doExecute()
{
// Initialise the application
$this->initialiseApp();
// Mark afterInitialise in the profiler.
JDEBUG ? $this->profiler->mark('afterInitialise') : null;
// Route the application
$this->sanityCheckSystemVariables();
$this->setupLogging();
$this->createExtensionNamespaceMap();
// Perform application routines.
$this->doExecute();
// If we have an application document object, render it.
if ($this->document instanceof \Joomla\CMS\Document\Document) {
// Render the application output.
$this->render();
// Set the application as global app
\Joomla\CMS\Factory::$application = $app;
// Execute the application.
$app->execute();
* define() is used rather than "const" to not error for PHP 5.2 and lower
*/
define('_JEXEC', 1);
// Run the application - All executable code should be triggered through this file
require_once dirname(__FILE__) . '/includes/app.php';
[2/2]
UndefinedFunctionError
|
---|
Symfony\Component\ErrorHandler\Error\UndefinedFunctionError: Attempted to call function "simplexml_load_file" from namespace "Joomla\CMS\Language". at /var/www/website/libraries/src/Language/LanguageHelper.php:611 at Joomla\CMS\Language\LanguageHelper::parseXMLLanguageFile() (/var/www/website/libraries/src/Language/LanguageHelper.php:513) at Joomla\CMS\Language\LanguageHelper::getMetadata() (/var/www/website/libraries/src/Language/Language.php:195) at Joomla\CMS\Language\Language->__construct() (/var/www/website/libraries/src/Language/LanguageFactory.php:35) at Joomla\CMS\Language\LanguageFactory->createLanguage() (/var/www/website/libraries/src/Language/CachingLanguageFactory.php:45) at Joomla\CMS\Language\CachingLanguageFactory->createLanguage() (/var/www/website/libraries/src/Factory.php:716) at Joomla\CMS\Factory::createLanguage() (/var/www/website/libraries/src/Factory.php:275) at Joomla\CMS\Factory::getLanguage() (/var/www/website/libraries/src/Menu/SiteMenu.php:72) at Joomla\CMS\Menu\SiteMenu->__construct() (/var/www/website/libraries/src/Menu/MenuFactory.php:55) at Joomla\CMS\Menu\MenuFactory->createMenu() (/var/www/website/libraries/src/Application/CMSApplication.php:519) at Joomla\CMS\Application\CMSApplication->getMenu() (/var/www/website/libraries/src/Application/SiteApplication.php:408) at Joomla\CMS\Application\SiteApplication->getTemplate() (/var/www/website/libraries/src/Error/Renderer/HtmlRenderer.php:50) at Joomla\CMS\Error\Renderer\HtmlRenderer->render() (/var/www/website/libraries/src/Exception/ExceptionHandler.php:121) at Joomla\CMS\Exception\ExceptionHandler::render() (/var/www/website/libraries/src/Exception/ExceptionHandler.php:72) at Joomla\CMS\Exception\ExceptionHandler::handleException() (/var/www/website/libraries/src/Application/CMSApplication.php:323) at Joomla\CMS\Application\CMSApplication->execute() (/var/www/website/includes/app.php:61) at require_once('/var/www/website/includes/app.php') (/var/www/website/index.php:32) |
[1/2]
UnsupportedAdapterException
|
---|
Joomla\Database\Exception\UnsupportedAdapterException: The MySQLi extension is not available at /var/www/website/libraries/vendor/joomla/database/src/Mysqli/MysqliDriver.php:161 at Joomla\Database\Mysqli\MysqliDriver->connect() (/var/www/website/libraries/vendor/joomla/session/src/Handler/DatabaseHandler.php:233) at Joomla\Session\Handler\DatabaseHandler->open() at session_start() (/var/www/website/libraries/vendor/joomla/session/src/Storage/NativeStorage.php:478) at Joomla\Session\Storage\NativeStorage->start() (/var/www/website/libraries/src/Session/Storage/JoomlaStorage.php:295) at Joomla\CMS\Session\Storage\JoomlaStorage->start() (/var/www/website/libraries/vendor/joomla/session/src/Session.php:406) at Joomla\Session\Session->start() (/var/www/website/libraries/vendor/joomla/session/src/Session.php:333) at Joomla\Session\Session->has() (/var/www/website/libraries/src/Session/Session.php:191) at Joomla\CMS\Session\Session->get() (/var/www/website/libraries/src/Factory.php:334) at Joomla\CMS\Factory::getUser() (/var/www/website/libraries/src/Application/SiteApplication.php:552) at Joomla\CMS\Application\SiteApplication->initialiseApp() (/var/www/website/libraries/src/Application/SiteApplication.php:218) at Joomla\CMS\Application\SiteApplication->doExecute() (/var/www/website/libraries/src/Application/CMSApplication.php:294) at Joomla\CMS\Application\CMSApplication->execute() (/var/www/website/includes/app.php:61) at require_once('/var/www/website/includes/app.php') (/var/www/website/index.php:32) |