ILIAS  trunk Revision v12.0_alpha-33-ge186251a14d
ShortlinkRequestBuilder.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
27
32{
33 public function buildRequest(Services $http, Factory $refinery, array $handlers): ?Request
34 {
35 $requested_url = $http->request()->getUri()->getPath();
36
37 if (
40 || str_contains($requested_url, rtrim(StandardURIBuilder::LONG, '/'))
41 ) {
42 return null;
43 }
44
45
46 return new Request(
48 null,
49 [basename($requested_url)]
50 );
51 }
52}
Builds data types.
Definition: Factory.php:36
Class Services.
Definition: Services.php:38
buildRequest(Services $http, Factory $refinery, array $handlers)
$http
Definition: deliver.php:30
$requested_url
Definition: deliver.php:32