CoreFiles by mySites.guru
provider.php46 lines, 1,387 bytes, from Joomla_6.1.3-Stable-Full_Package.zip
Raw History Compare with 6.1.2
md5
228fdd56b28d41e5b1d857f4c3024f92
sha1
12f7d2126f6aa6999be6843e69848984f108f28d
sha256
40c206cf1623f4c76dca41fe6505b6ac5c45c19334a22fb6e7a49cfb7c1418b2
<?php

/**
 * @package     Joomla.Plugin
 * @subpackage  Task.updatenotification
 *
 * @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\Task\UpdateNotification\Extension\UpdateNotification;

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,
            $container->lazy(UpdateNotification::class, function (Container $container) {
                $plugin = new UpdateNotification(
                    (array) PluginHelper::getPlugin('task', 'updatenotification')
                );
                $plugin->setApplication(Factory::getApplication());
                $plugin->setDatabase($container->get(DatabaseInterface::class));

                return $plugin;
            })
        );
    }
};

The same content is in 19 releases, Joomla 6.1.0-beta1 to 6.2.0-alpha1. See them all, or every version of this file.