CoreFiles by mySites.guru
provider.php47 lines, 1,361 bytes, from Joomla_4.4.2-Stable-Full_Package.zip
Raw History Compare with 4.4.1
md5
8fdaec30a2db4761af014b09a321a147
sha1
ad7b81cfaf1bc82d312add428757cfb120c275b4
sha256
e51edfd29ab727b3931bf88abcd345313be724f2b2b1be92243895946881ef02
<?php

/**
 * @package     Joomla.Plugin
 * @subpackage  Installer.packageinstaller
 *
 * @copyright   (C) 2023 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\Extension\PluginInterface;
use Joomla\CMS\Factory;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;
use Joomla\Event\DispatcherInterface;
use Joomla\Plugin\Installer\Package\Extension\PackageInstaller;

return new class () implements ServiceProviderInterface {
    /**
     * Registers the service provider with a DI container.
     *
     * @param   Container  $container  The DI container.
     *
     * @return  void
     *
     * @since   4.4.0
     */
    public function register(Container $container)
    {
        $container->set(
            PluginInterface::class,
            function (Container $container) {
                $dispatcher = $container->get(DispatcherInterface::class);
                $plugin     = new PackageInstaller(
                    $dispatcher,
                    (array) PluginHelper::getPlugin('installer', 'packageinstaller')
                );
                $plugin->setApplication(Factory::getApplication());

                return $plugin;
            }
        );
    }
};

The same content is in 37 releases, Joomla 4.4.0-alpha1 to 4.4.14. See them all, or every version of this file.