- md5
- c33674d6581e7d04d75a5a2df0bfc796
- sha1
- 25076851b3b6c336b8a8a41281ce317252025421
- sha256
- c7f4db011b843a296f86e32d1d406b0946bc989820aef194b367e032db724a05
<?php
/**
* @package Joomla.Administrator
* @subpackage com_messages
*
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @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\Messages\Administrator\Extension\MessagesComponent;
use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;
/**
* The messages 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\\Messages'));
$container->registerServiceProvider(new ComponentDispatcherFactory('\\Joomla\\Component\\Messages'));
$container->set(
ComponentInterface::class,
function (Container $container) {
$component = new MessagesComponent($container->get(ComponentDispatcherFactoryInterface::class));
$component->setMVCFactory($container->get(MVCFactoryInterface::class));
$component->setRegistry($container->get(Registry::class));
return $component;
}
);
}
};
The same content is in 60 releases, Joomla 4.3.0-beta1 to 5.0.0-beta3. See them all, or every version of this file.