CoreFiles by mySites.guru
provider.php58 lines, 2,030 bytes, from Joomla_4.3.2-Stable-Full_Package.zip
Raw History Compare with 4.3.1
md5
92aa7c652cef5f5b1e87033c9d731eb8
sha1
9f94673c6dd4d005b21090246cbb55daf41131af
sha256
9363cedbfeab93a9e58265886b154f514ece72937583cecb74e21dce545d084c
<?php

/**
 * @package     Joomla.Administrator
 * @subpackage  com_users
 *
 * @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\Component\Router\RouterFactoryInterface;
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\Extension\Service\Provider\RouterFactory;
use Joomla\CMS\HTML\Registry;
use Joomla\CMS\MVC\Factory\MVCFactoryInterface;
use Joomla\Component\Users\Administrator\Extension\UsersComponent;
use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;

/**
 * The users 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\\Users'));
        $container->registerServiceProvider(new ComponentDispatcherFactory('\\Joomla\\Component\\Users'));
        $container->registerServiceProvider(new RouterFactory('\\Joomla\\Component\\Users'));

        $container->set(
            ComponentInterface::class,
            function (Container $container) {
                $component = new UsersComponent($container->get(ComponentDispatcherFactoryInterface::class));
                $component->setMVCFactory($container->get(MVCFactoryInterface::class));
                $component->setRouterFactory($container->get(RouterFactoryInterface::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.