CoreFiles by mySites.guru
provider.php44 lines, 1,232 bytes, from Joomla_6.2.1-Stable-Full_Package.zip
Raw History Compare with 6.2.0
md5
739af813e61271486389440d2f39c593
sha1
26857aab3dee550d78a9a7138f0c3101e73ae490
sha256
87f236afd2139c993a3a944faf1236c6f49348443b0054835f0a59aac94b9644
<?php

/**
 * @package     Joomla.Plugin
 * @subpackage  Webservices.redirect
 *
 * @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\DI\Container;
use Joomla\DI\ServiceProviderInterface;
use Joomla\Plugin\WebServices\Redirect\Extension\Redirect;

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,
            $container->lazy(Redirect::class, function (Container $container) {
                $plugin     = new Redirect(
                    (array) PluginHelper::getPlugin('webservices', 'redirect')
                );
                $plugin->setApplication(Factory::getApplication());

                return $plugin;
            })
        );
    }
};

The same content is in 29 releases, Joomla 6.1.0-beta1 to 6.2.1. See them all, or every version of this file.