CoreFiles by mySites.guru
provider.php44 lines, 1,203 bytes, from Joomla_6.0.2-Stable-Full_Package.zip
Raw History Compare with 6.0.1
md5
40e8ecfe06cd2f10b315e231bbecbd9a
sha1
4c086a574d0a8c38d0fe7a6e03757fd23b9b98be
sha256
c1f21b8f00697a82b2aa1746274367d3c123a9df297e694d15586df112d36839
<?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\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(
                    (array) PluginHelper::getPlugin('extension', 'finder')
                );
                $plugin->setDatabase($container->get(DatabaseInterface::class));

                return $plugin;
            }
        );
    }
};

The same content is in 43 releases, Joomla 5.4.0-beta2 to 6.1.0-alpha3. See them all, or every version of this file.