ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
BundledRequestBuilder.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
25
30{
34
35 public function __construct()
36 {
37 $this->legacy = new LegacyRequestBuilder();
38 $this->static = new StaticURLRequestBuilder();
39 $this->shortlink = new ShortlinkRequestBuilder();
40 }
41
42 public function buildRequest(Services $http, Factory $refinery, array $handlers): ?Request
43 {
44 if (($request = $this->shortlink->buildRequest(
45 $http,
47 $handlers
48 )) instanceof Request) {
49 return $request;
50 }
51
52 if (($request = $this->legacy->buildRequest(
53 $http,
55 $handlers
56 )) instanceof Request) {
57 // we have now the situation that a new static URL is requested, but the handler is not yet registered or implemented
58 // we built a legacy request using the LegacyRequestBuilder for this to let the old system handle it.
59 return $request;
60 }
61
62 return $this->static->buildRequest($http, $refinery, $handlers);
63 }
64
65}
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