CoreFiles by mySites.guru
provider.php51 lines, 1,449 bytes, from Joomla_4.3.0-alpha3-Alpha-Full_Package.zip
Raw History Compare with 4.3.0-alpha2
md5
9506c1c618f521da875ecfcf5e54107a
sha1
c1162fc4643a1ae7d7dca5bd200b9a3e2239356e
sha256
5928ff2f092e1a90f5ad7520e14fab27b4016367f7853813a5bff692404bfae5
<?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\Database\DatabaseInterface;
use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;
use Joomla\Event\DispatcherInterface;
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,
            function (Container $container) {
                $dispatcher = $container->get(DispatcherInterface::class);

                $plugin = new Cookie(
                    $dispatcher,
                    (array) PluginHelper::getPlugin('authentication', 'cookie')
                );
                $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.