CoreFiles by mySites.guru
provider.php41 lines, 1,126 bytes, from Joomla_5.4.2-Stable-Full_Package.zip
Raw History Compare with 5.4.1
md5
ac47ffaddff4b73147079480a576dae8
sha1
bddba25e6b9408a9a24768f1e703e73996902a33
sha256
84d9f612aa3be52c1f6e8b244a066a9f76d86b8e461204804f27fe4214e4961d
<?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\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 = new Compat((array) PluginHelper::getPlugin('behaviour', 'compat'));
                $plugin->setApplication(Factory::getApplication());

                return $plugin;
            }
        );
    }
};

The same content is in 25 releases, Joomla 5.4.0-beta2 to 5.4.10. See them all, or every version of this file.