CoreFiles by mySites.guru
provider.php46 lines, 1,305 bytes, from Joomla_5.0.0-beta3-Beta-Full_Package.zip
Raw History Compare with 5.0.0-beta2
md5
bd21dea4f0535cd516cc6781297994b3
sha1
e65f4a84b6f97963f9b9712c1e2aba13205052e2
sha256
754a1607cc240e0c65bf1700245bd212d2be0f4568209e1c73529b2d1648f578
<?php

/**
 * @package     Joomla.Plugin
 * @subpackage  Extension.finder
 *
 * @copyright   (C) 2022 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\Plugin\PluginHelper;
use Joomla\Database\DatabaseInterface;
use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;
use Joomla\Event\DispatcherInterface;
use Joomla\Plugin\Extension\Finder\Extension\Finder;

return new class () implements ServiceProviderInterface {
    /**
     * Registers the service provider with a DI container.
     *
     * @param   Container  $container  The DI container.
     *
     * @return  void
     *
     * @since   4.3.0
     */
    public function register(Container $container)
    {
        $container->set(
            PluginInterface::class,
            function (Container $container) {
                $plugin     = new Finder(
                    $container->get(DispatcherInterface::class),
                    (array) PluginHelper::getPlugin('extension', 'finder')
                );
                $plugin->setDatabase($container->get(DatabaseInterface::class));

                return $plugin;
            }
        );
    }
};

The same content is in 6 releases, Joomla 5.0.0-alpha2 to 5.0.0-beta3. See them all, or every version of this file.