CoreFiles by mySites.guru
provider.php46 lines, 1,325 bytes, from Joomla_6.1.2-Stable-Full_Package.zip
Raw History Compare with 6.1.1
md5
9a50d114ada8b9511091710fa46eb8b0
sha1
fc62d1289d2140d12b7a5931a1292f20cd5b4c9f
sha256
116ab914abc1ed93c997604368c3aee009f09b2a43a485ec525afe15910945a4
<?php

/**
 * @package     Joomla.Plugin
 * @subpackage  User.profile
 *
 * @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\User\Profile\Extension\Profile;

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,
            $container->lazy(Profile::class, function (Container $container) {
                $plugin     = new Profile(
                    (array) PluginHelper::getPlugin('user', 'profile')
                );
                $plugin->setApplication(Factory::getApplication());
                $plugin->setDatabase($container->get(DatabaseInterface::class));

                return $plugin;
            })
        );
    }
};

The same content is in 28 releases, Joomla 6.1.0-beta1 to 6.2.1-rc1. See them all, or every version of this file.