CoreFiles by mySites.guru
provider.php55 lines, 1,634 bytes, from Joomla_4.0.0-beta1-Beta-Full_Package.zip
Raw History Compare with 3.9.0-beta4
md5
13d5ddf1f9057295830edbc1d94834ba
sha1
a9f9e3c3113a33edab0229c53925432050112148
sha256
cb9ca931db9cfa23e4d79b66df50f90b3e3fed44860e260c4392d8713ee55187
<?php
/**
 * @package     Joomla.Administrator
 * @subpackage  com_installer
 *
 * @copyright   Copyright (C) 2005 - 2020 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\Installer\Administrator\Extension\InstallerComponent;
use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;

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

		$container->set(
			ComponentInterface::class,
			function (Container $container)
			{
				$component = new InstallerComponent($container->get(ComponentDispatcherFactoryInterface::class));
				$component->setMVCFactory($container->get(MVCFactoryInterface::class));
				$component->setRegistry($container->get(Registry::class));

				return $component;
			}
		);
	}
};

The same content is in 5 releases, Joomla 4.0.0-beta to 4.0.0-beta5. See them all, or every version of this file.