CoreFiles by mySites.guru
provider.php46 lines, 1,300 bytes, from Joomla_5.4.3-Stable-Full_Package.zip
Raw History Compare with 5.4.2
md5
acd24516412300869f4ffa1f3512f496
sha1
42330328e8a1988fbd6fd1d370c9a3fbfc34f1da
sha256
c47c6306497f5e7d834246879ca42df45f5d1716aa3faa5203a781c20265386c
<?php

/**
 * @package     Joomla.Plugin
 * @subpackage  Privacy.contact
 *
 * @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\Database\DatabaseInterface;
use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;
use Joomla\Plugin\Privacy\Contact\Extension\Contact;

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): void
    {
        $container->set(
            PluginInterface::class,
            function (Container $container) {
                $plugin     = new Contact(
                    (array) PluginHelper::getPlugin('privacy', 'contact')
                );
                $plugin->setApplication(Factory::getApplication());
                $plugin->setDatabase($container->get(DatabaseInterface::class));

                return $plugin;
            }
        );
    }
};

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