CoreFiles by mySites.guru
provider.php52 lines, 1,482 bytes, from Joomla_4.2.2-Stable-Full_Package.zip
Raw History Compare with 4.2.1
md5
e8a6e70be30c355ae1e04432b35bd1eb
sha1
cc0d41c5196c87d995aa58de54bd01f0f49d3d1d
sha256
5f56e1587b1059deb5376133e3809abf7efcca523ebd9294d6e9ee7296e92735
<?php

/**
 * @package     Joomla.Plugin
 * @subpackage  Behaviour.versionable
 *
 * @copyright   (C) 2022 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\Helper\CMSHelper;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;
use Joomla\Event\DispatcherInterface;
use Joomla\Filter\InputFilter;
use Joomla\Plugin\Behaviour\Versionable\Extension\Versionable;

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

                return $plugin;
            }
        );
    }
};

The same content is in 22 releases, Joomla 4.2.0-beta3 to 4.3.0-alpha3. See them all, or every version of this file.