CoreFiles by mySites.guru
provider.php45 lines, 1,291 bytes, from Joomla_4.4.4-Stable-Full_Package.zip
Raw History Compare with 4.4.3
md5
c4cf310ef8280a1959e88fb85254a6b8
sha1
5ecce0ef4e8e5af9d7f9e44aa778627cf56518ea
sha256
ffcf80943d3433b6339eadb1810332cc37335690b6740ccb200e6f224421f400
<?php

/**
 * @package     Joomla.Plugin
 * @subpackage  Behaviour.compat
 *
 * @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\Behaviour\Compat\Extension\Compat;

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)
    {
        $container->set(
            PluginInterface::class,
            function (Container $container) {
                $plugin     = PluginHelper::getPlugin('behaviour', 'compat');
                $dispatcher = $container->get(DispatcherInterface::class);

                $plugin = new Compat($dispatcher, (array) $plugin);
                $plugin->setApplication(Factory::getApplication());

                return $plugin;
            }
        );
    }
};

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