CoreFiles by mySites.guru
provider.php46 lines, 1,301 bytes, from Joomla_5.4.2-Stable-Full_Package.zip
Raw History Compare with 5.4.1
md5
37b8f265699c3b333cae3755a864d797
sha1
5a3073f48afc65e5dbe632ee419b0eb056a4c44e
sha256
5ed97ce53f2bd8dadae4ad03f5b495022392dd959ff50ce2aed7aafb5bae1db4
<?php

/**
 * @package     Joomla.Plugin
 * @subpackage  Finder.newsfeeds
 *
 * @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\Database\DatabaseInterface;
use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;
use Joomla\Plugin\Finder\Newsfeeds\Extension\Newsfeeds;

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 Newsfeeds(
                    (array) PluginHelper::getPlugin('finder', 'newsfeeds')
                );
                $plugin->setApplication(Factory::getApplication());
                $plugin->setDatabase($container->get(DatabaseInterface::class));

                return $plugin;
            }
        );
    }
};

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