/**
* Factory to create MVC objects based on a namespace.
*
* @since 3.10.0
*/
class MVCFactory implements MVCFactoryInterface, FormFactoryAwareInterface, SiteRouterAwareInterface, UserFactoryAwareInterface, MailerFactoryAwareInterface
{
use FormFactoryAwareTrait;
use DispatcherAwareTrait;
use DatabaseAwareTrait;
use SiteRouterAwareTrait;
* @return void
* @private
*/
function includeFile($file)
{
include $file;
}
* @return true|null True if loaded, null otherwise
*/
public function loadClass($class)
{
if ($file = $this->findFile($class)) {
includeFile($file);
return true;
}
return null;
*
* @since 3.4
*/
public function loadClass($class)
{
if ($result = $this->loader->loadClass($class)) {
\JLoader::applyAliasFor($class);
}
return $result;
}
MVCFactoryInterface::class,
function (Container $container) {
if (\Joomla\CMS\Factory::getApplication()->isClient('api')) {
$factory = new ApiMVCFactory($this->namespace);
} else {
$factory = new \Joomla\CMS\MVC\Factory\MVCFactory($this->namespace);
}
$factory->setFormFactory($container->get(FormFactoryInterface::class));
$factory->setDispatcher($container->get(DispatcherInterface::class));
$factory->setDatabase($container->get(DatabaseInterface::class));
}
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.
*
public function register(Container $container)
{
$container->set(
ComponentDispatcherFactoryInterface::class,
function (Container $container) {
return new \Joomla\CMS\Dispatcher\ComponentDispatcherFactory($this->namespace, $container->get(MVCFactoryInterface::class));
}
);
}
}
}
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->registerServiceProvider(new ComponentDispatcherFactory('\\Joomla\\Component\\Admin'));
$container->set(
ComponentInterface::class,
function (Container $container) {
$component = new AdminComponent($container->get(ComponentDispatcherFactoryInterface::class));
$component->setMVCFactory($container->get(MVCFactoryInterface::class));
$component->setRegistry($container->get(Registry::class));
return $component;
}
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);
}
$component = str_starts_with($component, 'com_') ? substr($component, 4) : $component;
// Path to look for services
$path = JPATH_ADMINISTRATOR . '/components/com_' . $component;
return $this->loadExtension(ComponentInterface::class, $component, $path);
}
/**
* Boots the module with the given name.
*
public function collect(): array
{
/** @type SiteApplication|AdministratorApplication $application */
$application = Factory::getApplication();
$model = $application->bootComponent('com_admin')
->getMVCFactory()->createModel('Sysinfo', 'Administrator');
return [
'phpVersion' => PHP_VERSION,
'joomlaVersion' => JVERSION,
$request_variables
)
);
foreach ($this->collectors as $name => $collector) {
$this->data[$name] = $collector->collect();
}
// Remove all invalid (non UTF-8) characters
array_walk_recursive($this->data, function (&$item) {
if (is_string($item) && !mb_check_encoding($item, 'UTF-8')) {
* @return array
*/
public function getData()
{
if ($this->data === null) {
$this->collect();
}
return $this->data;
}
/**
$js .= $this->getAddDatasetCode($id, $data, '(stacked)');
}
}
$suffix = !$initialize ? '(ajax)' : null;
$js .= $this->getAddDatasetCode($this->debugBar->getCurrentRequestId(), $this->debugBar->getData(), $suffix);
$nonce = '';
if ($doc->cspNonce) {
$nonce = ' nonce="' . $doc->cspNonce . '"';
echo $contents;
return;
}
echo str_replace('</body>', $debugBarRenderer->renderHead() . $debugBarRenderer->render() . '</body>', $contents);
}
/**
* AJAX handler
*
if ($event->isStopped())
{
return $event;
}
$listener($event);
}
}
return $event;
}
// Send the application response.
$this->respond();
// Trigger the onAfterRespond event.
$this->getDispatcher()->dispatch('onAfterRespond');
}
/**
* Check if the user is required to reset their password.
*
// 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';
ClassNotFoundError
|
---|
Symfony\Component\ErrorHandler\Error\ClassNotFoundError: Attempted to load interface "FormFactoryAwareInterface" from namespace "Joomla\CMS\Form". Did you forget a "use" statement for another namespace? at /home/www/01-PROD/02-LEMONDEDUDROIT/01-SITE/libraries/src/MVC/Factory/MVCFactory.php:42 at include() (/home/www/01-PROD/02-LEMONDEDUDROIT/01-SITE/libraries/vendor/composer/ClassLoader.php:571) at Composer\Autoload\includeFile() (/home/www/01-PROD/02-LEMONDEDUDROIT/01-SITE/libraries/vendor/composer/ClassLoader.php:428) at Composer\Autoload\ClassLoader->loadClass() (/home/www/01-PROD/02-LEMONDEDUDROIT/01-SITE/libraries/src/Autoload/ClassLoader.php:59) at Joomla\CMS\Autoload\ClassLoader->loadClass() at spl_autoload_call() (/home/www/01-PROD/02-LEMONDEDUDROIT/01-SITE/libraries/src/Extension/Service/Provider/MVCFactory.php:73) at Joomla\CMS\Extension\Service\Provider\MVCFactory->Joomla\CMS\Extension\Service\Provider\{closure}() (/home/www/01-PROD/02-LEMONDEDUDROIT/01-SITE/libraries/vendor/joomla/di/src/ContainerResource.php:182) at Joomla\DI\ContainerResource->getInstance() (/home/www/01-PROD/02-LEMONDEDUDROIT/01-SITE/libraries/vendor/joomla/di/src/Container.php:96) at Joomla\DI\Container->get() (/home/www/01-PROD/02-LEMONDEDUDROIT/01-SITE/libraries/src/Extension/Service/Provider/ComponentDispatcherFactory.php:63) at Joomla\CMS\Extension\Service\Provider\ComponentDispatcherFactory->Joomla\CMS\Extension\Service\Provider\{closure}() (/home/www/01-PROD/02-LEMONDEDUDROIT/01-SITE/libraries/vendor/joomla/di/src/ContainerResource.php:182) at Joomla\DI\ContainerResource->getInstance() (/home/www/01-PROD/02-LEMONDEDUDROIT/01-SITE/libraries/vendor/joomla/di/src/Container.php:96) at Joomla\DI\Container->get() (/home/www/01-PROD/02-LEMONDEDUDROIT/01-SITE/administrator/components/com_admin/services/provider.php:46) at class@anonymous /home/www/01-PROD/02-LEMONDEDUDROIT/01-SITE/administrator/components/com_admin/services/provider.php:28$27c->{closure}() (/home/www/01-PROD/02-LEMONDEDUDROIT/01-SITE/libraries/vendor/joomla/di/src/ContainerResource.php:182) at Joomla\DI\ContainerResource->getInstance() (/home/www/01-PROD/02-LEMONDEDUDROIT/01-SITE/libraries/vendor/joomla/di/src/Container.php:96) at Joomla\DI\Container->get() (/home/www/01-PROD/02-LEMONDEDUDROIT/01-SITE/libraries/src/Extension/ExtensionManagerTrait.php:177) at Joomla\CMS\Application\CMSApplication->loadExtension() (/home/www/01-PROD/02-LEMONDEDUDROIT/01-SITE/libraries/src/Extension/ExtensionManagerTrait.php:51) at Joomla\CMS\Application\CMSApplication->bootComponent() (/home/www/01-PROD/02-LEMONDEDUDROIT/01-SITE/plugins/system/debug/src/DataCollector/InfoCollector.php:126) at Joomla\Plugin\System\Debug\DataCollector\InfoCollector->collect() (/home/www/01-PROD/02-LEMONDEDUDROIT/01-SITE/libraries/vendor/maximebf/debugbar/src/DebugBar/DebugBar.php:238) at DebugBar\DebugBar->collect() (/home/www/01-PROD/02-LEMONDEDUDROIT/01-SITE/libraries/vendor/maximebf/debugbar/src/DebugBar/DebugBar.php:265) at DebugBar\DebugBar->getData() (/home/www/01-PROD/02-LEMONDEDUDROIT/01-SITE/plugins/system/debug/src/JavascriptRenderer.php:119) at Joomla\Plugin\System\Debug\JavascriptRenderer->render() (/home/www/01-PROD/02-LEMONDEDUDROIT/01-SITE/plugins/system/debug/src/Extension/Debug.php:368) at Joomla\Plugin\System\Debug\Extension\Debug->onAfterRespond() (/home/www/01-PROD/02-LEMONDEDUDROIT/01-SITE/libraries/vendor/joomla/event/src/Dispatcher.php:486) at Joomla\Event\Dispatcher->dispatch() (/home/www/01-PROD/02-LEMONDEDUDROIT/01-SITE/libraries/src/Application/CMSApplication.php:332) at Joomla\CMS\Application\CMSApplication->execute() (/home/www/01-PROD/02-LEMONDEDUDROIT/01-SITE/includes/app.php:61) at require_once('/home/www/01-PROD/02-LEMONDEDUDROIT/01-SITE/includes/app.php') (/home/www/01-PROD/02-LEMONDEDUDROIT/01-SITE/index.php:32) |