- md5
- 702fdb94d91f178218aa9040b3ae1f96
- sha1
- 63ebf1e9f717e6240b0263abc504669497256996
- sha256
- 30baab9f4fd9b5917803f84039cae2960d0636452b23a048497d7fed2bea789c
<?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\CMS\Profiler\Profiler;
use Joomla\CMS\Router\SiteRouter;
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 5.0.0
*/
public function register(Container $container)
{
$container->set(
PluginInterface::class,
function (Container $container) {
$plugin = PluginHelper::getPlugin('behaviour', 'compat');
$dispatcher = $container->get(DispatcherInterface::class);
$profiler = (defined('JDEBUG') && JDEBUG) ? Profiler::getInstance('Application') : null;
$router = $container->has(SiteRouter::class) ? $container->get(SiteRouter::class) : null;
$plugin = new Compat($dispatcher, (array) $plugin, $profiler, $router);
$plugin->setApplication(Factory::getApplication());
return $plugin;
}
);
}
};
The same content is in 2 releases, Joomla 5.0.0-alpha4 to 5.0.0-beta1. See them all, or every version of this file.