$container->alias('language.factory', LanguageFactoryInterface::class) ->alias(CachingLanguageFactory::class, LanguageFactoryInterface::class) ->share( LanguageFactoryInterface::class, function (Container $container) { return new CachingLanguageFactory(); }, true ); }} { $callable = $this->factory; if ($this->isShared()) { if ($this->instance === null) { $this->instance = $callable($this->container); } return $this->instance; } } throw new KeyNotFoundException(sprintf("Resource '%s' has not been registered with the container.", $resourceName)); } return $this->resources[$key]->getInstance(); } /** * Check if specified resource exists. * ); $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 = []) { // 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('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 'subject' => $app, 'document' => $renderer->getDocument(), ]) ); $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->dispatchEvent('onError', $event); ExceptionHandler::handleException($event->getError()); } // Trigger the onBeforeRespond event. $this->dispatchEvent( 'onBeforeRespond',// Set the application as global app\Joomla\CMS\Factory::$application = $app;// Execute the application.$app->execute(); // ... die die();}// Run the application - All executable code should be triggered through this filerequire_once __DIR__ . '/includes/app.php'; $params = ComponentHelper::getParams('com_languages'); $options['language'] = $params->get('site', $this->get('language', 'en-GB')); } // One last check to make sure we have something if (!LanguageHelper::exists($options['language'])) { $lang = $this->config->get('language', 'en-GB'); if (LanguageHelper::exists($lang)) { $options['language'] = $lang; } else { * @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(); // ... die die();}// Run the application - All executable code should be triggered through this filerequire_once __DIR__ . '/includes/app.php';|
[2/2]
ClassNotFoundError
|
|---|
Symfony\Component\ErrorHandler\Error\ClassNotFoundError:
Attempted to load class "CachingLanguageFactory" from namespace "Joomla\CMS\Language".
Did you forget a "use" statement for another namespace?
at /var/www/vhosts/anstiftung.de/httpdocs/libraries/src/Service/Provider/Language.php:44
at Joomla\CMS\Service\Provider\Language->Joomla\CMS\Service\Provider\{closure}()
(/var/www/vhosts/anstiftung.de/httpdocs/libraries/vendor/joomla/di/src/ContainerResource.php:162)
at Joomla\DI\ContainerResource->getInstance()
(/var/www/vhosts/anstiftung.de/httpdocs/libraries/vendor/joomla/di/src/Container.php:95)
at Joomla\DI\Container->get()
(/var/www/vhosts/anstiftung.de/httpdocs/libraries/src/Factory.php:745)
at Joomla\CMS\Factory::createLanguage()
(/var/www/vhosts/anstiftung.de/httpdocs/libraries/src/Factory.php:305)
at Joomla\CMS\Factory::getLanguage()
(/var/www/vhosts/anstiftung.de/httpdocs/libraries/src/Menu/SiteMenu.php:72)
at Joomla\CMS\Menu\SiteMenu->__construct()
(/var/www/vhosts/anstiftung.de/httpdocs/libraries/src/Menu/MenuFactory.php:55)
at Joomla\CMS\Menu\MenuFactory->createMenu()
(/var/www/vhosts/anstiftung.de/httpdocs/libraries/src/Application/CMSApplication.php:590)
at Joomla\CMS\Application\CMSApplication->getMenu()
(/var/www/vhosts/anstiftung.de/httpdocs/libraries/src/Application/SiteApplication.php:425)
at Joomla\CMS\Application\SiteApplication->getTemplate()
(/var/www/vhosts/anstiftung.de/httpdocs/libraries/src/Error/Renderer/HtmlRenderer.php:50)
at Joomla\CMS\Error\Renderer\HtmlRenderer->render()
(/var/www/vhosts/anstiftung.de/httpdocs/libraries/src/Exception/ExceptionHandler.php:142)
at Joomla\CMS\Exception\ExceptionHandler::render()
(/var/www/vhosts/anstiftung.de/httpdocs/libraries/src/Exception/ExceptionHandler.php:76)
at Joomla\CMS\Exception\ExceptionHandler::handleException()
(/var/www/vhosts/anstiftung.de/httpdocs/libraries/src/Application/CMSApplication.php:334)
at Joomla\CMS\Application\CMSApplication->execute()
(/var/www/vhosts/anstiftung.de/httpdocs/includes/app.php:58)
at require_once('/var/www/vhosts/anstiftung.de/httpdocs/includes/app.php')
(/var/www/vhosts/anstiftung.de/httpdocs/index.php:51)
|
|
[1/2]
Error
|
|---|
Error:
Class "Joomla\CMS\Language\LanguageHelper" not found
at /var/www/vhosts/anstiftung.de/httpdocs/libraries/src/Application/SiteApplication.php:626
at Joomla\CMS\Application\SiteApplication->initialiseApp()
(/var/www/vhosts/anstiftung.de/httpdocs/libraries/src/Application/SiteApplication.php:237)
at Joomla\CMS\Application\SiteApplication->doExecute()
(/var/www/vhosts/anstiftung.de/httpdocs/libraries/src/Application/CMSApplication.php:304)
at Joomla\CMS\Application\CMSApplication->execute()
(/var/www/vhosts/anstiftung.de/httpdocs/includes/app.php:58)
at require_once('/var/www/vhosts/anstiftung.de/httpdocs/includes/app.php')
(/var/www/vhosts/anstiftung.de/httpdocs/index.php:51)
|