CoreFiles by mySites.guru
provider.php48 lines, 1,510 bytes, from Joomla_6.1.3-Stable-Full_Package.zip
Raw History Compare with 6.1.2
md5
69b3afcc4be451d5ffbd2cc62e3f1ffe
sha1
7b9556c3165af32278328fe194ab7da492ead9f2
sha256
4f47b91b7a9ff66f294ba8e9e524b15a20b60f038eba0ec4157405151c56d95d
<?php

/**
 * @package     Joomla.Plugin
 * @subpackage  System.tasknotification
 *
 * @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\CMS\User\UserFactoryInterface;
use Joomla\Database\DatabaseInterface;
use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;
use Joomla\Plugin\System\TaskNotification\Extension\TaskNotification;

return new class () implements ServiceProviderInterface {
    /**
     * Registers the service provider with a DI container.
     *
     * @param   Container  $container  The DI container.
     *
     * @return  void
     *
     * @since   4.4.0
     */
    public function register(Container $container): void
    {
        $container->set(
            PluginInterface::class,
            $container->lazy(TaskNotification::class, function (Container $container) {
                $plugin = new TaskNotification(
                    (array) PluginHelper::getPlugin('system', 'tasknotification')
                );
                $plugin->setApplication(Factory::getApplication());
                $plugin->setDatabase($container->get(DatabaseInterface::class));
                $plugin->setUserFactory($container->get(UserFactoryInterface::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.