CoreFiles by mySites.guru
provider.php46 lines, 1,337 bytes, from Joomla_6.2.0-Stable-Full_Package.zip
Raw History Compare with 6.1.4
md5
f9d653678c65b6d5263d22732c45bf94
sha1
3c210a8db91c69e852a5b0354c244d7fd0b05775
sha256
c2d7b227e08bf9ec97915a104c9708e0de01862b14228cda333a3ba1f2b6dedd
<?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,
            $container->lazy(Newsfeeds::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 30 releases, Joomla 6.1.0-beta1 to 6.3.0-alpha1. See them all, or every version of this file.