CoreFiles by mySites.guru
provider.php46 lines, 1,301 bytes, from Joomla_6.2.0-alpha2-Alpha-Full_Package.zip
Raw History Compare with 6.2.0-alpha1
md5
8b78b4a1fd248ae427c76fd2908beb37
sha1
d64605558bb787d8cdeafcd6d0fc0dc717836c9b
sha256
a84be9372b54ad2f35e6bfa296ff358ef1383db6fa622a1fe49b435c26a25063
<?php

/**
 * @package     Joomla.Plugin
 * @subpackage  Fields.sql
 *
 * @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\Fields\SQL\Extension\SQL;

return new class () implements ServiceProviderInterface {
    /**
     * Registers the service provider with a DI container.
     *
     * @param   Container  $container  The DI container.
     *
     * @return  void
     *
     * @since   4.3.0
     */
    public function register(Container $container)
    {
        $container->set(
            PluginInterface::class,
            $container->lazy(SQL::class, function (Container $container) {
                $plugin     = new SQL(
                    (array) PluginHelper::getPlugin('fields', 'sql')
                );
                $plugin->setApplication(Factory::getApplication());
                $plugin->setDatabase($container->get(DatabaseInterface::class));

                return $plugin;
            })
        );
    }
};

The same content is in 9 releases, Joomla 6.2.0-alpha2 to 6.2.1-rc1. See them all, or every version of this file.