47 lines
1021 B
PHP
47 lines
1021 B
PHP
<?php
|
|
/**
|
|
* @package Octoleo CMS
|
|
*
|
|
* @created 14th April 2022
|
|
* @author Llewellyn van der Merwe <https://git.vdm.dev/Llewellyn>
|
|
* @git WEBD-325-45 <https://git.vdm.dev/Llewellyn/WEBD-325-45>
|
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
|
*/
|
|
|
|
namespace Octoleo\CMS\Service;
|
|
|
|
use Joomla\DI\Container;
|
|
use Joomla\DI\ServiceProviderInterface;
|
|
|
|
use Joomla\Input\Input;
|
|
|
|
/**
|
|
* Input service provider
|
|
*/
|
|
class InputProvider implements ServiceProviderInterface
|
|
{
|
|
/**
|
|
* Registers the service provider with a DI container.
|
|
*
|
|
* @param Container $container The DI container.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function register(Container $container): void
|
|
{
|
|
$container->share(Input::class, [$this, 'getInputClassService'], true);
|
|
}
|
|
|
|
/**
|
|
* Get the Input class service
|
|
*
|
|
* @param Container $container The DI container.
|
|
*
|
|
* @return Input
|
|
*/
|
|
public function getInputClassService(Container $container): Input
|
|
{
|
|
return new Input($_REQUEST);
|
|
}
|
|
}
|