ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
Services.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
21 namespace ILIAS\HTTP;
22 
30 
37 class Services implements GlobalHttpState
38 {
39  protected GlobalHttpState $raw;
40  protected WrapperFactory $wrapper;
41  protected AgentDetermination $agent;
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 }
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:46
WrapperFactory $wrapper
Definition: Services.php:40
saveRequest(ServerRequestInterface $request)
Definition: Services.php:111
AgentDetermination $agent
Definition: Services.php:41
$response
Definition: xapitoken.php:93
saveResponse(ResponseInterface $response)
Definition: Services.php:119
GlobalHttpState $raw
Definition: Services.php:39
$dic
Definition: result.php:31
Provides an interface to the ILIAS HTTP services.