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