__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ 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\Routing;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\RequestHandlerInterface;
use Slim\Exception\HttpMethodNotAllowedException;
use Slim\Exception\HttpNotFoundException;
use Slim\Interfaces\RouteCollectorProxyInterface;
use Slim\Interfaces\RouteParserInterface;
use Slim\Interfaces\RouteResolverInterface;
use Slim\Middleware\RoutingMiddleware;
class RouteRunner implements RequestHandlerInterface
{
private RouteResolverInterface $routeResolver;
private RouteParserInterface $routeParser;
private ?RouteCollectorProxyInterface $routeCollectorProxy;
public function __construct(
RouteResolverInterface $routeResolver,
RouteParserInterface $routeParser,
?RouteCollectorProxyInterface $routeCollectorProxy = null
) {
$this->routeResolver = $routeResolver;
$this->routeParser = $routeParser;
$this->routeCollectorProxy = $routeCollectorProxy;
}
/**
* This request handler is instantiated automatically in App::__construct()
* It is at the very tip of the middleware queue meaning it will be executed
* last and it detects whether or not routing has been performed in the user
* defined middleware stack. In the event that the user did not perform routing
* it is done here
*
* @throws HttpNotFoundException
* @throws HttpMethodNotAllowedException
*/
public function handle(ServerRequestInterface $request): ResponseInterface
{
// If routing hasn't been done, then do it now so we can dispatch
if ($request->getAttribute(RouteContext::ROUTING_RESULTS) === null) {
$routingMiddleware = new RoutingMiddleware($this->routeResolver, $this->routeParser);
$request = $routingMiddleware->performRouting($request);
}
if ($this->routeCollectorProxy !== null) {
$request = $request->withAttribute(
RouteContext::BASE_PATH,
$this->routeCollectorProxy->getBasePath()
);
}
/** @var Route $route */
$route = $request->getAttribute(RouteContext::ROUTE);
return $route->run($request);
}
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| Dispatcher.php | File | 2.41 KB | 0777 |
|
| FastRouteDispatcher.php | File | 3.1 KB | 0777 |
|
| Route.php | File | 8.82 KB | 0777 |
|
| RouteCollector.php | File | 7.47 KB | 0777 |
|
| RouteCollectorProxy.php | File | 4.52 KB | 0777 |
|
| RouteContext.php | File | 2.36 KB | 0777 |
|
| RouteGroup.php | File | 2.47 KB | 0777 |
|
| RouteParser.php | File | 3.81 KB | 0777 |
|
| RouteResolver.php | File | 1.48 KB | 0777 |
|
| RouteRunner.php | File | 2.34 KB | 0777 |
|
| RoutingResults.php | File | 2.32 KB | 0777 |
|