ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
Services.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21namespace ILIAS\HTTP;
22
25use Psr\Http\Message\ResponseInterface;
26use Psr\Http\Message\ServerRequestInterface;
30
37class Services implements GlobalHttpState
38{
42
46 public function __construct(Container $dic)
47 {
48 $this->raw = new RawHTTPServices(
49 $dic['http.response_sender_strategy'],
50 $dic['http.cookie_jar_factory'],
51 $dic['http.request_factory'],
52 $dic['http.response_factory'],
53 $dic['http.duration_factory']
54 );
55 $this->wrapper = new WrapperFactory($this->raw->request());
56 $this->agent = new AgentDetermination();
57 }
58
59 public function durations(): DurationFactory
60 {
61 return $this->raw->durations();
62 }
63
64 public function wrapper(): WrapperFactory
65 {
66 return $this->wrapper;
67 }
68
73 public function raw(): RawHTTPServices
74 {
75 return $this->raw;
76 }
77
83 public function request(): ServerRequestInterface
84 {
85 return $this->raw()->request();
86 }
87
93 public function response(): ResponseInterface
94 {
95 return $this->raw()->response();
96 }
97
103 public function cookieJar(): CookieJar
104 {
105 return $this->raw()->cookieJar();
106 }
107
111 public function saveRequest(ServerRequestInterface $request): void
112 {
113 $this->raw()->saveRequest($request);
114 }
115
119 public function saveResponse(ResponseInterface $response): void
120 {
121 $this->raw()->saveResponse($response);
122 }
123
127 public function sendResponse(): void
128 {
129 $this->raw()->sendResponse();
130 }
131
132 public function close(): void
133 {
134 $this->raw()->close();
135 }
136
137 public function agent(): AgentDetermination
138 {
139 return $this->agent;
140 }
141}
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:36
This library is borrowed from the phpGroupWare API http://www.phpgroupware.org/api Modifications made...
Provides an interface to the ILIAS HTTP services.
Class Services.
Definition: Services.php:38
GlobalHttpState $raw
Definition: Services.php:39
WrapperFactory $wrapper
Definition: Services.php:40
__construct(Container $dic)
Services constructor.
Definition: Services.php:46
AgentDetermination $agent
Definition: Services.php:41
saveResponse(ResponseInterface $response)
@inheritDoc
Definition: Services.php:119
sendResponse()
@inheritDoc
Definition: Services.php:127
saveRequest(ServerRequestInterface $request)
@inheritDoc
Definition: Services.php:111
Interface GlobalHttpState.
$dic
Definition: ltiresult.php:33
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$response
Definition: xapitoken.php:93