CoreFiles by mySites.guru
provider.php49 lines, 1,439 bytes, from Joomla_5.0.0-alpha1-Alpha-Full_Package.zip
Raw History Compare with 4.4.0-alpha4
md5
7658380942257614de884444bb827678
sha1
02123ded0982a7ab1508c08dcb9d31ead8d4213a
sha256
ae86e478adf709989e25d66295f0d57b9f960fdd00d224494f911326ecdd9202
<?php

/**
 * @package     Joomla.Plugin
 * @subpackage  Sampledata.blog
 *
 * @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\SampleData\Blog\Extension\Blog;

return new class () implements ServiceProviderInterface {
    /**
     * Registers the service provider with a DI container.
     *
     * @param   Container  $container  The DI container.
     *
     * @return  void
     *
     * @since   5.0.0
     */
    public function register(Container $container): void
    {
        $container->set(
            PluginInterface::class,
            function (Container $container) {
                $dispatcher = $container->get(DispatcherInterface::class);
                $plugin     = new Blog(
                    $dispatcher,
                    (array) PluginHelper::getPlugin('sampledata', 'blog')
                );
                $plugin->setApplication(Factory::getApplication());
                $plugin->setDatabase($container->get(DatabaseInterface::class));

                return $plugin;
            }
        );
    }
};

No other release has this exact content. See every version of this file.