* * @since 1.7.0 */ public function __construct($options) { $this->cache = new Cache($options); $this->options = &$this->cache->_options; // Overwrite default options with given options foreach ($options as $option => $value) { if ($value !== null) { // The class should now be loaded if (!class_exists($class)) { throw new \RuntimeException('Unable to load Cache Controller: ' . $type, 500); } return new $class($options); }} return $items; }; try { /** @var CallbackController $cache */ $cache = $this->getCacheControllerFactory()->createCacheController('callback', ['defaultgroup' => 'com_menus']); $this->items = $cache->get($loader, [], md5(\get_class($this)), false); } catch (CacheExceptionInterface) { try { $this->items = $loader(); * @since 1.5 */ public function getMenu() { if (!$this->itemsLoaded) { $this->load(); foreach ($this->items as $item) { if ($item->home) { $this->default[trim($item->language)] = $item->id; } */ public function getItem($id) { $result = null; if (isset($this->getMenu()[$id])) { $result = &$this->getMenu()[$id]; } return $result; } { $menu = $this->getMenu(); $item = $menu->getActive(); if (!$item) { $item = $menu->getItem($this->input->getInt('Itemid', 0)); } $id = 0; if ($item) { * * @throws \InvalidArgumentException */ protected function initialiseTemplate(): void { $id = $this->getTemplateStyleId(); $templates = $this->getTemplates(); $template = $templates[$id] ?? $templates[0]; * @since 3.2 */ public function getTemplate($params = false) { if (!\is_object($this->template)) { $this->initialiseTemplate(); } if (!$this->isValidTemplate($this->template)) { throw new \InvalidArgumentException( Text::sprintf('JERROR_COULD_NOT_FIND_TEMPLATE', $this->template->template) 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'; * * @since 1.7.0 */ public function __construct($options) { $this->cache = new Cache($options); $this->options = &$this->cache->_options; // Overwrite default options with given options foreach ($options as $option => $value) { if ($value !== null) { // The class should now be loaded if (!class_exists($class)) { throw new \RuntimeException('Unable to load Cache Controller: ' . $type, 500); } return new $class($options); }} return $components; }; /** @var CallbackController $cache */ $cache = Factory::getContainer()->get(CacheControllerFactoryInterface::class)->createCacheController('callback', ['defaultgroup' => '_system']); try { static::$components = $cache->get($loader, [], __METHOD__); } catch (CacheExceptionInterface) { static::$components = $loader(); * @since 3.6.3 */ public static function getComponents() { if (empty(static::$components)) { static::load(); } return static::$components; } * * @since 1.5 */ public static function getComponent($option, $strict = false) { $components = static::getComponents(); if (isset($components[$option])) { return $components[$option]; } * @see Registry * @since 1.5 */ public static function getParams($option, $strict = false) { return static::getComponent($option, $strict)->getParams(); } /** * Applies the global text filters to arbitrary text as per settings for current user groups * // Creates a simple unique string for each parameter combination: $storeId = $userId . ':' . (int) $recursive; if (!isset(self::$groupsByUser[$storeId])) { // @todo: Uncouple this from ComponentHelper and allow for a configuration setting or value injection. $guestUsergroup = (int) ComponentHelper::getParams('com_users')->get('guest_usergroup', 1); // Guest user (if only the actually assigned group is requested) if (empty($userId) && !$recursive) { $result = [$guestUsergroup]; } else { return array_values(array_unique($authorised)); } // Get all groups that the user is mapped to recursively. $groups = self::getGroupsByUser($userId); // Find the authorised levels. foreach (self::$viewLevels as $level => $rule) { foreach ($rule as $id) { if (($id < 0) && (($id * -1) == $userId)) { if ($this->_authLevels === null) { $this->_authLevels = []; } if (empty($this->_authLevels)) { $this->_authLevels = Access::getAuthorisedViewLevels($this->id); } return $this->_authLevels; } { if (static::$plugins !== null) { return static::$plugins; } $levels = Factory::getUser()->getAuthorisedViewLevels(); /** @var \Joomla\CMS\Cache\Controller\CallbackController $cache */ $cache = Factory::getCache('com_plugins', 'callback'); $loader = function () use ($levels) { if (!$defaults || !isset($loaded[$dispatcherHash][$type])) { $results = null; // Load the plugins from the database. $plugins = static::load(); // Get the specified plugin(s). foreach ($plugins as $value) { if ($value->type === $type && ($plugin === null || $value->name === $plugin)) { static::import($value, $autocreate, $dispatcher); $this->sanityCheckSystemVariables(); $this->setupLogging(); $this->createExtensionNamespaceMap(); // Load the behaviour plugins PluginHelper::importPlugin('behaviour', null, true, $this->getDispatcher()); // Load the system plugins PluginHelper::importPlugin('system', null, true, $this->getDispatcher()); // Trigger the onBeforeExecute event// 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 "Cache" from namespace "Joomla\CMS\Cache".
Did you forget a "use" statement for another namespace?
at /home/arboresczr/cadonicicosta/libraries/src/Cache/CacheController.php:53
at Joomla\CMS\Cache\CacheController->__construct(array('defaultgroup' => 'com_menus'))
(/home/arboresczr/cadonicicosta/libraries/src/Cache/CacheControllerFactory.php:49)
at Joomla\CMS\Cache\CacheControllerFactory->createCacheController('callback', array('defaultgroup' => 'com_menus'))
(/home/arboresczr/cadonicicosta/libraries/src/Menu/SiteMenu.php:177)
at Joomla\CMS\Menu\SiteMenu->load()
(/home/arboresczr/cadonicicosta/libraries/src/Menu/AbstractMenu.php:333)
at Joomla\CMS\Menu\AbstractMenu->getMenu()
(/home/arboresczr/cadonicicosta/libraries/src/Menu/AbstractMenu.php:164)
at Joomla\CMS\Menu\AbstractMenu->getItem(0)
(/home/arboresczr/cadonicicosta/libraries/src/Application/SiteApplication.php:808)
at Joomla\CMS\Application\SiteApplication->getTemplateStyleId()
(/home/arboresczr/cadonicicosta/libraries/src/Application/SiteApplication.php:756)
at Joomla\CMS\Application\SiteApplication->initialiseTemplate()
(/home/arboresczr/cadonicicosta/libraries/src/Application/CMSApplication.php:721)
at Joomla\CMS\Application\CMSApplication->getTemplate(true)
(/home/arboresczr/cadonicicosta/libraries/src/Error/Renderer/HtmlRenderer.php:50)
at Joomla\CMS\Error\Renderer\HtmlRenderer->render(object(Error))
(/home/arboresczr/cadonicicosta/libraries/src/Exception/ExceptionHandler.php:142)
at Joomla\CMS\Exception\ExceptionHandler::render(object(Error))
(/home/arboresczr/cadonicicosta/libraries/src/Exception/ExceptionHandler.php:76)
at Joomla\CMS\Exception\ExceptionHandler::handleException(object(Error))
(/home/arboresczr/cadonicicosta/libraries/src/Application/CMSApplication.php:350)
at Joomla\CMS\Application\CMSApplication->execute()
(/home/arboresczr/cadonicicosta/includes/app.php:58)
at require_once('/home/arboresczr/cadonicicosta/includes/app.php')
(/home/arboresczr/cadonicicosta/index.php:51)
|
|
[1/2]
Error
|
|---|
Error:
Class "Joomla\CMS\Cache\Cache" not found
at /home/arboresczr/cadonicicosta/libraries/src/Cache/CacheController.php:53
at Joomla\CMS\Cache\CacheController->__construct(array('defaultgroup' => '_system'))
(/home/arboresczr/cadonicicosta/libraries/src/Cache/CacheControllerFactory.php:49)
at Joomla\CMS\Cache\CacheControllerFactory->createCacheController('callback', array('defaultgroup' => '_system'))
(/home/arboresczr/cadonicicosta/libraries/src/Component/ComponentHelper.php:407)
at Joomla\CMS\Component\ComponentHelper::load()
(/home/arboresczr/cadonicicosta/libraries/src/Component/ComponentHelper.php:428)
at Joomla\CMS\Component\ComponentHelper::getComponents()
(/home/arboresczr/cadonicicosta/libraries/src/Component/ComponentHelper.php:56)
at Joomla\CMS\Component\ComponentHelper::getComponent('com_users', false)
(/home/arboresczr/cadonicicosta/libraries/src/Component/ComponentHelper.php:114)
at Joomla\CMS\Component\ComponentHelper::getParams('com_users')
(/home/arboresczr/cadonicicosta/libraries/src/Access/Access.php:833)
at Joomla\CMS\Access\Access::getGroupsByUser(0)
(/home/arboresczr/cadonicicosta/libraries/src/Access/Access.php:982)
at Joomla\CMS\Access\Access::getAuthorisedViewLevels(0)
(/home/arboresczr/cadonicicosta/libraries/src/User/User.php:475)
at Joomla\CMS\User\User->getAuthorisedViewLevels()
(/home/arboresczr/cadonicicosta/libraries/src/Plugin/PluginHelper.php:270)
at Joomla\CMS\Plugin\PluginHelper::load()
(/home/arboresczr/cadonicicosta/libraries/src/Plugin/PluginHelper.php:188)
at Joomla\CMS\Plugin\PluginHelper::importPlugin('behaviour', null, true, object(Dispatcher))
(/home/arboresczr/cadonicicosta/libraries/src/Application/CMSApplication.php:305)
at Joomla\CMS\Application\CMSApplication->execute()
(/home/arboresczr/cadonicicosta/includes/app.php:58)
at require_once('/home/arboresczr/cadonicicosta/includes/app.php')
(/home/arboresczr/cadonicicosta/index.php:51)
|