1 | <?php |
||
38 | class RestRequestHandler implements RequestHandlerInterface |
||
39 | { |
||
40 | /** |
||
41 | * Instance of the current TYPO3 bootstrap |
||
42 | * @var Bootstrap |
||
43 | */ |
||
44 | protected $bootstrap; |
||
45 | |||
46 | /** |
||
47 | * The request handed over |
||
48 | * @var \Psr\Http\Message\ServerRequestInterface |
||
49 | */ |
||
50 | protected $request; |
||
51 | |||
52 | /** |
||
53 | * Constructor handing over the bootstrap |
||
54 | * |
||
55 | * @param Bootstrap $bootstrap |
||
56 | */ |
||
57 | public function __construct(Bootstrap $bootstrap) |
||
61 | |||
62 | /** |
||
63 | * Handles a frontend request |
||
64 | * |
||
65 | * @param \Psr\Http\Message\ServerRequestInterface $request |
||
66 | * |
||
67 | * @return NULL|\Psr\Http\Message\ResponseInterface |
||
68 | */ |
||
69 | public function handleRequest(\Psr\Http\Message\ServerRequestInterface $request) |
||
78 | |||
79 | /** |
||
80 | * This request handler can handle any frontend request. |
||
81 | * |
||
82 | * @param ServerRequestInterface $request |
||
83 | * |
||
84 | * @return bool If the request is not an eID request, TRUE otherwise FALSE |
||
85 | */ |
||
86 | public function canHandleRequest(ServerRequestInterface $request) |
||
90 | |||
91 | /** |
||
92 | * Returns the priority. |
||
93 | * |
||
94 | * Shows how eager the handler is to actually handle the |
||
95 | * request. An integer > 0 means "I want to handle this request" where |
||
96 | * "100" is default. "0" means "I am a fallback solution" |
||
97 | * |
||
98 | * @return int The priority of the request handler. |
||
99 | */ |
||
100 | public function getPriority() |
||
104 | |||
105 | /** |
||
106 | * @param ServerRequestInterface $request |
||
107 | * |
||
108 | * @return bool |
||
109 | */ |
||
110 | private function isRequestApi(ServerRequestInterface $request) |
||
114 | |||
115 | /** |
||
116 | * @param ServerRequestInterface $request |
||
117 | * |
||
118 | * @return bool |
||
119 | */ |
||
120 | private function isRequestApiExplorer(ServerRequestInterface $request) |
||
124 | } |