CoreFiles by mySites.guru
provider.php48 lines, 1,404 bytes, from Joomla_5.2.3-Stable-Full_Package.zip
Raw History Compare with 5.2.2
md5
fad9f20f86a1a391fa38e6cb6ed61841
sha1
a574cb95aab75f495f33a3102a1be7074534fd13
sha256
b93fd933c271bf257be2875499c58d502d72f87de2f9629723d1f4f0582575d7
<?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\Event\DispatcherInterface;
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(
                    $container->get(DispatcherInterface::class),
                    (array) PluginHelper::getPlugin('finder', 'newsfeeds')
                );
                $plugin->setApplication(Factory::getApplication());
                $plugin->setDatabase($container->get(DatabaseInterface::class));

                return $plugin;
            }
        );
    }
};

The same content is in 77 releases, Joomla 5.0.0-rc to 6.0.0-beta1. See them all, or every version of this file.