CoreFiles by mySites.guru
provider.php44 lines, 1,181 bytes, from Joomla_6.1.0-Stable-Full_Package.zip
Raw History Compare with 6.0.4
md5
564d1828a7cdae78414b4798ac1f562e
sha1
a1284dd330c694c7cf74cbe610644a63d3fe3967
sha256
d70d2f58168f25feb96b0190637b2793e02fa9120612de445a12b3a13a7e05b4
<?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\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());

                return $plugin;
            })
        );
    }
};

The same content is in 19 releases, Joomla 6.1.0-beta1 to 6.2.0-alpha1. See them all, or every version of this file.