CoreFiles by mySites.guru
provider.php48 lines, 1,370 bytes, from Joomla_5.2.2-Stable-Full_Package.zip
Raw History Compare with 5.2.1
md5
72fcf8d7001c18da0f8f94dacaa59051
sha1
36518179cb8caea14e24a1f99e7fad920af6c658
sha256
154bc7b533f1354de48ffcd8e958c03eb6f348e71dcd0020a1c3ea591c66dd41
<?php

/**
 * @package     Joomla.Plugin
 * @subpackage  System.sef
 *
 * @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\Router\SiteRouter;
use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;
use Joomla\Event\DispatcherInterface;
use Joomla\Plugin\System\Sef\Extension\Sef;

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 Sef(
                    $container->get(DispatcherInterface::class),
                    (array) PluginHelper::getPlugin('system', 'sef')
                );
                $plugin->setApplication(Factory::getApplication());
                $plugin->setSiteRouter($container->get(SiteRouter::class));

                return $plugin;
            }
        );
    }
};

The same content is in 61 releases, Joomla 5.1.0-beta2 to 6.0.0-beta1. See them all, or every version of this file.