CoreFiles by mySites.guru
provider.php48 lines, 1,386 bytes, from Joomla_4.4.0-Stable-Full_Package.zip
Raw History Compare with 4.3.4
md5
a292d9ee83208178955880af698e8130
sha1
646ce49c11180a96b80493679574c2d083c78fa1
sha256
daddff5aede96dd85ea6c63d847bd7d017b38057db87a46d531e58326fc4e0f7
<?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   4.4.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;
            }
        );
    }
};

The same content is in 40 releases, Joomla 4.4.0-alpha1 to 5.0.0-alpha4. See them all, or every version of this file.