CoreFiles by mySites.guru
provider.php44 lines, 1,299 bytes, from Joomla_6.1.4-Stable-Full_Package.zip
Raw History Compare with 6.1.3
md5
615e64890f0a8e4c1d8e832fc4c9e3d3
sha1
e7228850d67d332c1b99994a08e982500ec3e4a6
sha256
a7d868e58d0c4175f5b28950f50ab20f01810765dc68d04e1ef14b2405d27292
<?php

/**
 * @package     Joomla.Plugin
 * @subpackage  Multifactorauth.totp
 *
 * @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') || die;

use Joomla\CMS\Extension\PluginInterface;
use Joomla\CMS\Factory;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\CMS\User\UserFactoryInterface;
use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;
use Joomla\Plugin\Multifactorauth\Totp\Extension\Totp;

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,
            $container->lazy(Totp::class, function (Container $container) {
                $plugin = new Totp((array) PluginHelper::getPlugin('multifactorauth', 'totp'));
                $plugin->setApplication(Factory::getApplication());
                $plugin->setUserFactory($container->get(UserFactoryInterface::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.