CoreFiles by mySites.guru
provider.php48 lines, 1,386 bytes, from Joomla_5.0.0-alpha1-Alpha-Full_Package.zip
Raw History Compare with 4.4.0-alpha4
md5
01afcbccc17c23b79b678b035c144c56
sha1
2fe158ffc4e612a7b8ffadbeb0aba3c5646ea4b1
sha256
49ab9018bf6739d8ef0f9a5f27ea8080d1620f0a3f5b8ef388d77072cb479229
<?php

/**
 * @package     Joomla.Plugin
 * @subpackage  System.sessiongc
 *
 * @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\Session\MetadataManager;
use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;
use Joomla\Event\DispatcherInterface;
use Joomla\Plugin\System\SessionGC\Extension\SessionGC;

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) {
                $plugin = new SessionGC(
                    $container->get(DispatcherInterface::class),
                    (array) PluginHelper::getPlugin('system', 'sessiongc'),
                    $container->get(MetadataManager::class)
                );
                $plugin->setApplication(Factory::getApplication());

                return $plugin;
            }
        );
    }
};

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