- md5
- b9af8fa92db3cbac103c04137d844971
- sha1
- 5da41f7ded2cfe152a5b8b8e77a0bd614db32f74
- sha256
- 2d6116d1155809ca20853b76e38fb279607762650823374452c64d9045cf16b4
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
<?php
/**
* @package Joomla.Administrator
* @subpackage com_modules
*
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Dispatcher\ComponentDispatcherFactoryInterface;
use Joomla\CMS\Extension\ComponentInterface;
use Joomla\CMS\Extension\Service\Provider\ComponentDispatcherFactory;
use Joomla\CMS\Extension\Service\Provider\MVCFactory;
use Joomla\CMS\HTML\Registry;
use Joomla\CMS\MVC\Factory\MVCFactoryInterface;
use Joomla\Component\Modules\Administrator\Extension\ModulesComponent;
use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;
/**
* The module service provider.
*
* @since 4.0.0
*/
return new class implements ServiceProviderInterface
{
/**
* Registers the service provider with a DI container.
*
* @param Container $container The DI container.
*
* @return void
*
* @since 4.0.0
*/
public function register(Container $container)
{
$container->registerServiceProvider(new MVCFactory('\\Joomla\\Component\\Modules'));
$container->registerServiceProvider(new ComponentDispatcherFactory('\\Joomla\\Component\\Modules'));
$container->set(
ComponentInterface::class,
function (Container $container)
{
$component = new ModulesComponent($container->get(ComponentDispatcherFactoryInterface::class));
$component->setMVCFactory($container->get(MVCFactoryInterface::class));
$component->setRegistry($container->get(Registry::class));
return $component;
}
);
}
};
The same content is in 2 releases, Joomla 4.0.0-alpha5 to 4.0.0-alpha6. See them all, or every version of this file.