CoreFiles by mySites.guru
provider.php46 lines, 1,253 bytes, from Joomla_5.0.0-alpha4-Alpha-Full_Package.zip
Raw History Compare with 5.0.0-alpha3
md5
174672d2a5c22c9541653dcdee123439
sha1
16a14764e3a1fe57c4eac4275eae5e4c31d47458
sha256
0d5170526877a934469450efe6c56ab585305ae78c35a1c66a4b7b82232d3ecb
<?php

/**
 * @package     Joomla.Plugin
 * @subpackage  Fields.url
 *
 * @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\Event\DispatcherInterface;
use Joomla\Plugin\Fields\Url\Extension\Url;

return new class () implements ServiceProviderInterface {
    /**
     * Registers the service provider with a DI container.
     *
     * @param   Container  $container  The DI container.
     *
     * @return  void
     *
     * @since   4.3.0
     */
    public function register(Container $container)
    {
        $container->set(
            PluginInterface::class,
            function (Container $container) {
                $plugin     = new Url(
                    $container->get(DispatcherInterface::class),
                    (array) PluginHelper::getPlugin('fields', 'url')
                );
                $plugin->setApplication(Factory::getApplication());

                return $plugin;
            }
        );
    }
};

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