CoreFiles by mySites.guru
provider.php48 lines, 1,380 bytes, from Joomla_5.0.0-beta3-Beta-Full_Package.zip
Raw History Compare with 5.0.0-beta2
md5
80a00cb749501b3ed63629cc95f1e11c
sha1
3583cbcab3538c193c8e1bc6182e928f8894b8fd
sha256
5891cd5c8fb542389700308f675f9a529415fc8b719b91ae997b329e2d1b55ed
<?php

/**
 * @package     Joomla.Plugin
 * @subpackage  Task.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\Task\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('task', 'sessiongc'),
                    $container->get(MetadataManager::class)
                );
                $plugin->setApplication(Factory::getApplication());

                return $plugin;
            }
        );
    }
};

The same content is in 3 releases, Joomla 5.0.0-beta1 to 5.0.0-beta3. See them all, or every version of this file.