$container->alias('document.factory', FactoryInterface::class) ->alias(Factory::class, FactoryInterface::class) ->share( FactoryInterface::class, function (Container $container) { $factory = new Factory(); $factory->setCacheControllerFactory($container->get(CacheControllerFactoryInterface::class)); return $factory; }, 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. * if (Factory::$language) { $attributes['language'] = Factory::getLanguage()->getTag(); $attributes['direction'] = Factory::getLanguage()->isRtl() ? 'rtl' : 'ltr'; } return Factory::getContainer()->get(FactoryInterface::class)->createDocument($this->type, $attributes); }} */ public function getDocument(): Document { // Load the document if not already if (!$this->document) { $this->document = $this->loadDocument(); } return $this->document; } // Default to the HTML renderer $renderer = AbstractRenderer::getRenderer('html'); } // 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); // Trigger the onAfterInitialiseDocument event. $app->getDispatcher()->dispatch( 'onAfterInitialiseDocument', * @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'; public function register(Container $container): void { $container->set( PluginInterface::class, function (Container $container) { $plugin = new Log( (array) PluginHelper::getPlugin('system', 'log') ); return $plugin; } } return $this->instance; } return $callable($this->container); } /** * Get the factory * } throw new KeyNotFoundException(sprintf("Resource '%s' has not been registered with the container.", $resourceName)); } return $this->resources[$key]->getInstance(); } /** * Check if specified resource exists. * 'container' => $container, ] ) ); $extension = $container->get($type); if ($extension instanceof BootableExtensionInterface) { $extension->boot($container); } $plugin = str_starts_with($plugin, 'plg_') ? substr($plugin, 4) : $plugin; // Path to look for services $path = JPATH_SITE . '/plugins/' . $type . '/' . $plugin; return $this->loadExtension(PluginInterface::class, $plugin . ':' . $type, $path); } /** * Loads the extension. * return; } $plugins[$hash] = true; $plugin = Factory::getApplication()->bootPlugin($plugin->name, $plugin->type); if ($dispatcher && $plugin instanceof DispatcherAwareInterface) { $plugin->setDispatcher($dispatcher); } $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); $results = true; } } // Bail out early if we're not using default args // Load the behaviour plugins PluginHelper::importPlugin('behaviour', null, true, $this->getDispatcher()); // Trigger the onAfterInitialise event. PluginHelper::importPlugin('system', null, true, $this->getDispatcher()); $this->dispatchEvent( 'onAfterInitialise', new AfterInitialiseEvent('onAfterInitialise', ['subject' => $this]) ); } $options['language'] = 'en-GB'; } } // Finish initialisation parent::initialiseApp($options); } /** * Load the library language files for the application * * @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 "Factory" from namespace "Joomla\CMS\Document".
Did you forget a "use" statement for another namespace?
at /home/essmaria/agmlbk1.essmaria.info/libraries/src/Service/Provider/Document.php:45
at Joomla\CMS\Service\Provider\Document->{closure:Joomla\CMS\Service\Provider\Document::register():44}()
(/home/essmaria/agmlbk1.essmaria.info/libraries/vendor/joomla/di/src/ContainerResource.php:162)
at Joomla\DI\ContainerResource->getInstance()
(/home/essmaria/agmlbk1.essmaria.info/libraries/vendor/joomla/di/src/Container.php:95)
at Joomla\DI\Container->get()
(/home/essmaria/agmlbk1.essmaria.info/libraries/src/Error/AbstractRenderer.php:112)
at Joomla\CMS\Error\AbstractRenderer->loadDocument()
(/home/essmaria/agmlbk1.essmaria.info/libraries/src/Error/AbstractRenderer.php:54)
at Joomla\CMS\Error\AbstractRenderer->getDocument()
(/home/essmaria/agmlbk1.essmaria.info/libraries/src/Exception/ExceptionHandler.php:130)
at Joomla\CMS\Exception\ExceptionHandler::render()
(/home/essmaria/agmlbk1.essmaria.info/libraries/src/Exception/ExceptionHandler.php:76)
at Joomla\CMS\Exception\ExceptionHandler::handleException()
(/home/essmaria/agmlbk1.essmaria.info/libraries/src/Application/CMSApplication.php:334)
at Joomla\CMS\Application\CMSApplication->execute()
(/home/essmaria/agmlbk1.essmaria.info/includes/app.php:58)
at require_once('/home/essmaria/agmlbk1.essmaria.info/includes/app.php')
(/home/essmaria/agmlbk1.essmaria.info/index.php:51)
|
|
[1/2]
Error
|
|---|
Error:
Class "Joomla\Plugin\System\Log\Extension\Log" not found
at /home/essmaria/agmlbk1.essmaria.info/plugins/system/log/services/provider.php:34
at Joomla\DI\ServiceProviderInterface@anonymous /home/essmaria/agmlbk1.essmaria.info/plugins/system/log/services/provider.php:19$1c9->{closure:Joomla\DI\ServiceProviderInterface@anonymous /home/essmaria/agmlbk1.essmaria.info/plugins/system/log/services/provider.php:19$1c9::register():33}()
(/home/essmaria/agmlbk1.essmaria.info/libraries/vendor/joomla/di/src/ContainerResource.php:168)
at Joomla\DI\ContainerResource->getInstance()
(/home/essmaria/agmlbk1.essmaria.info/libraries/vendor/joomla/di/src/Container.php:95)
at Joomla\DI\Container->get()
(/home/essmaria/agmlbk1.essmaria.info/libraries/src/Extension/ExtensionManagerTrait.php:177)
at Joomla\CMS\Application\CMSApplication->loadExtension()
(/home/essmaria/agmlbk1.essmaria.info/libraries/src/Extension/ExtensionManagerTrait.php:99)
at Joomla\CMS\Application\CMSApplication->bootPlugin()
(/home/essmaria/agmlbk1.essmaria.info/libraries/src/Plugin/PluginHelper.php:232)
at Joomla\CMS\Plugin\PluginHelper::import()
(/home/essmaria/agmlbk1.essmaria.info/libraries/src/Plugin/PluginHelper.php:192)
at Joomla\CMS\Plugin\PluginHelper::importPlugin()
(/home/essmaria/agmlbk1.essmaria.info/libraries/src/Application/CMSApplication.php:812)
at Joomla\CMS\Application\CMSApplication->initialiseApp()
(/home/essmaria/agmlbk1.essmaria.info/libraries/src/Application/SiteApplication.php:638)
at Joomla\CMS\Application\SiteApplication->initialiseApp()
(/home/essmaria/agmlbk1.essmaria.info/libraries/src/Application/SiteApplication.php:237)
at Joomla\CMS\Application\SiteApplication->doExecute()
(/home/essmaria/agmlbk1.essmaria.info/libraries/src/Application/CMSApplication.php:304)
at Joomla\CMS\Application\CMSApplication->execute()
(/home/essmaria/agmlbk1.essmaria.info/includes/app.php:58)
at require_once('/home/essmaria/agmlbk1.essmaria.info/includes/app.php')
(/home/essmaria/agmlbk1.essmaria.info/index.php:51)
|