CoreFiles by mySites.guru
Input.php50 lines, 1,417 bytes, from Joomla_5.0.0-alpha3-Alpha-Full_Package.zip
Raw History Compare with 5.0.0-alpha2
md5
b6d625c4fbd23a94f99b36cd2b412257
sha1
ec79377ceaa697f54de50e8b53a81a377ca02fcc
sha256
faff5aa8eb54807613d43c21e01ab6a8d1e27b52aa4fe72ed961b24eab87a1c5
<?php

/**
 * Joomla! Content Management System
 *
 * @copyright   (C) 2023 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE
 */

namespace Joomla\CMS\Service\Provider;

use Joomla\CMS\Input\Input as CMSInput;
use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;

/**
 * Service provider for the the Joomla Input object.
 *
 * Whilst generally speaking it's an anti-pattern for the request object to be in a DIC, in the case of Joomla whilst
 * there, both the web application class and session class have a hard dependency on the input object, as a result it's
 * required that this exists in the DIC for now. Strategically there should be a long term plan to remove this from the
 * DIC.
 *
 * @note It is strongly recommended that extensions get the input object from the application and DO NOT use this
 * service container.
 *
 * @since  5.0.0
 */
class Input implements ServiceProviderInterface
{
    /**
     * Registers the service provider with a DI container.
     *
     * @param   Container  $container  The DI container.
     *
     * @return  void
     *
     * @since   5.0.0
     */
    public function register(Container $container)
    {
        $container->share(
            CMSInput::class,
            function () {
                return new CMSInput();
            },
            true
        );
    }
}

No other release has this exact content. See every version of this file.