CoreFiles by mySites.guru
provider.php48 lines, 1,468 bytes, from Joomla_6.2.0-Stable-Full_Package.zip
Raw History Compare with 6.1.4
md5
7c8fa5ecfa2f82c38bf58ebbd3e70fb2
sha1
1ceb4582afbe62f6ba120c2d016702a33c5087b6
sha256
6a88dd25d21bd1f4011d226f9ddcb2f58ac8afa4db71f0d19f391e615a36f85a
<?php

/**
 * @package     Joomla.Plugin
 * @subpackage  Authentication.cookie
 *
 * @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\Authentication\Cookie\Extension\Cookie;

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(Cookie::class, function (Container $container) {
                $plugin = new Cookie(
                    (array) PluginHelper::getPlugin('authentication', 'cookie')
                );
                $plugin->setApplication(Factory::getApplication());
                $plugin->setDatabase($container->get(DatabaseInterface::class));
                $plugin->setUserFactory($container->get(UserFactoryInterface::class));

                return $plugin;
            })
        );
    }
};

The same content is in 28 releases, Joomla 6.1.0-beta1 to 6.2.1-rc1. See them all, or every version of this file.