CoreFiles by mySites.guru
provider.php50 lines, 1,374 bytes, from Joomla_4.2.3-Stable-Full_Package.zip
Raw History Compare with 4.2.2
md5
6ec59888dae0077a202319b697766c13
sha1
0d389a5b666f1cebdb752a6931ec2744ab7ddd07
sha256
071c73840daa5906b7f305d12f5927a55b5279cce13b0093695e8f18b58a01e6
<?php

/**
 * @package     Joomla.Plugin
 * @subpackage  Task.requests
 *
 * @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') 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\Event\DispatcherInterface;
use Joomla\Http\HttpFactory;
use Joomla\Plugin\Task\Requests\Extension\Requests;

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,
            function (Container $container) {
                $plugin = new Requests(
                    $container->get(DispatcherInterface::class),
                    (array) PluginHelper::getPlugin('task', 'requests'),
                    new HttpFactory(),
                    JPATH_ROOT . '/tmp'
                );
                $plugin->setApplication(Factory::getApplication());

                return $plugin;
            }
        );
    }
};

The same content is in 22 releases, Joomla 4.2.0-beta3 to 4.3.0-alpha3. See them all, or every version of this file.