ILIAS  release_8 Revision v8.23
ILIAS\HTTP\RawHTTPServices Class Reference

Provides an interface to the ILIAS HTTP services. More...

+ Inheritance diagram for ILIAS\HTTP\RawHTTPServices:
+ Collaboration diagram for ILIAS\HTTP\RawHTTPServices:

Public Member Functions

 __construct (ResponseSenderStrategy $senderStrategy, CookieJarFactory $cookieJarFactory, RequestFactory $requestFactory, ResponseFactory $responseFactory, DurationFactory $durationFactory)
 RawHTTPServices constructor. More...
 
 durations ()
 
 wrapper ()
 
 cookieJar ()
 
 request ()
 
 response ()
 
 saveRequest (ServerRequestInterface $request)
 
 saveResponse (ResponseInterface $response)
 
 sendResponse ()
 
 close ()
 

Private Attributes

ILIAS HTTP Response Sender ResponseSenderStrategy $sender
 
ILIAS HTTP Cookies CookieJarFactory $cookieJarFactory
 
ILIAS HTTP Request RequestFactory $requestFactory
 
ILIAS HTTP Response ResponseFactory $responseFactory
 
ILIAS HTTP Duration DurationFactory $durationFactory
 
Psr Http Message ServerRequestInterface $request = null
 
Psr Http Message ResponseInterface $response = null
 

Detailed Description

Provides an interface to the ILIAS HTTP services.

Author
Nicolas Schäfli ns@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch

Definition at line 36 of file RawHTTPServices.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\HTTP\RawHTTPServices::__construct ( ResponseSenderStrategy  $senderStrategy,
CookieJarFactory  $cookieJarFactory,
RequestFactory  $requestFactory,
ResponseFactory  $responseFactory,
DurationFactory  $durationFactory 
)

RawHTTPServices constructor.

Parameters
ResponseSenderStrategy$senderStrategyA response sender strategy.
CookieJarFactory$cookieJarFactoryCookie Jar implementation.

Definition at line 53 of file RawHTTPServices.php.

References ILIAS\HTTP\RawHTTPServices\$cookieJarFactory, ILIAS\HTTP\RawHTTPServices\$durationFactory, ILIAS\HTTP\RawHTTPServices\$requestFactory, and ILIAS\HTTP\RawHTTPServices\$responseFactory.

59  {
60  $this->sender = $senderStrategy;
61  $this->cookieJarFactory = $cookieJarFactory;
62  $this->requestFactory = $requestFactory;
63  $this->responseFactory = $responseFactory;
64  $this->durationFactory = $durationFactory;
65  }
ILIAS HTTP Duration DurationFactory $durationFactory
ILIAS HTTP Response ResponseFactory $responseFactory
ILIAS HTTP Cookies CookieJarFactory $cookieJarFactory
ILIAS HTTP Request RequestFactory $requestFactory

Member Function Documentation

◆ close()

ILIAS\HTTP\RawHTTPServices::close ( )

Implements ILIAS\HTTP\GlobalHttpState.

Definition at line 144 of file RawHTTPServices.php.

References exit.

144  : void
145  {
146  exit;
147  }
exit
Definition: login.php:28

◆ cookieJar()

ILIAS\HTTP\RawHTTPServices::cookieJar ( )

Implements ILIAS\HTTP\GlobalHttpState.

Definition at line 81 of file RawHTTPServices.php.

References ILIAS\HTTP\RawHTTPServices\response().

Referenced by ILIAS\HTTP\RawHTTPServices\sendResponse().

81  : CookieJar
82  {
83  return $this->cookieJarFactory->fromResponse($this->response());
84  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ durations()

ILIAS\HTTP\RawHTTPServices::durations ( )

Implements ILIAS\HTTP\GlobalHttpState.

Definition at line 67 of file RawHTTPServices.php.

References ILIAS\HTTP\RawHTTPServices\$durationFactory.

67  : DurationFactory
68  {
70  }
ILIAS HTTP Duration DurationFactory $durationFactory

◆ request()

ILIAS\HTTP\RawHTTPServices::request ( )

Implements ILIAS\HTTP\GlobalHttpState.

Definition at line 90 of file RawHTTPServices.php.

References ILIAS\HTTP\RawHTTPServices\$request.

Referenced by ILIAS\HTTP\RawHTTPServices\saveRequest(), and ILIAS\HTTP\RawHTTPServices\wrapper().

90  : \Psr\Http\Message\RequestInterface
91  {
92  if ($this->request === null) {
93  $this->request = $this->requestFactory->create();
94  }
95 
96  return $this->request;
97  }
Psr Http Message ServerRequestInterface $request
+ Here is the caller graph for this function:

◆ response()

ILIAS\HTTP\RawHTTPServices::response ( )

Implements ILIAS\HTTP\GlobalHttpState.

Definition at line 103 of file RawHTTPServices.php.

References ILIAS\HTTP\RawHTTPServices\$response.

Referenced by ILIAS\HTTP\RawHTTPServices\cookieJar(), ILIAS\HTTP\RawHTTPServices\saveResponse(), and ILIAS\HTTP\RawHTTPServices\sendResponse().

103  : ResponseInterface
104  {
105  if ($this->response === null) {
106  $this->response = $this->responseFactory->create();
107  }
108 
109  return $this->response;
110  }
Psr Http Message ResponseInterface $response
+ Here is the caller graph for this function:

◆ saveRequest()

ILIAS\HTTP\RawHTTPServices::saveRequest ( ServerRequestInterface  $request)

Implements ILIAS\HTTP\GlobalHttpState.

Definition at line 116 of file RawHTTPServices.php.

References ILIAS\HTTP\RawHTTPServices\$request, and ILIAS\HTTP\RawHTTPServices\request().

116  : void
117  {
118  $this->request = $request;
119  }
Psr Http Message ServerRequestInterface $request
+ Here is the call graph for this function:

◆ saveResponse()

ILIAS\HTTP\RawHTTPServices::saveResponse ( ResponseInterface  $response)

Implements ILIAS\HTTP\GlobalHttpState.

Definition at line 125 of file RawHTTPServices.php.

References ILIAS\HTTP\RawHTTPServices\$response, and ILIAS\HTTP\RawHTTPServices\response().

125  : void
126  {
127  $this->response = $response;
128  }
Psr Http Message ResponseInterface $response
+ Here is the call graph for this function:

◆ sendResponse()

ILIAS\HTTP\RawHTTPServices::sendResponse ( )

Implements ILIAS\HTTP\GlobalHttpState.

Definition at line 134 of file RawHTTPServices.php.

References ILIAS\HTTP\RawHTTPServices\cookieJar(), and ILIAS\HTTP\RawHTTPServices\response().

134  : void
135  {
136  // Render Cookies to the response.
137  $response = $this->response();
138  $response = $this->cookieJar()->renderIntoResponseHeader($response);
139 
140  $this->sender->sendResponse($response);
141  }
Psr Http Message ResponseInterface $response
+ Here is the call graph for this function:

◆ wrapper()

ILIAS\HTTP\RawHTTPServices::wrapper ( )

Implements ILIAS\HTTP\GlobalHttpState.

Definition at line 72 of file RawHTTPServices.php.

References ILIAS\HTTP\RawHTTPServices\request().

72  : WrapperFactory
73  {
74  return new WrapperFactory($this->request());
75  }
+ Here is the call graph for this function:

Field Documentation

◆ $cookieJarFactory

ILIAS HTTP Cookies CookieJarFactory ILIAS\HTTP\RawHTTPServices::$cookieJarFactory
private

Definition at line 39 of file RawHTTPServices.php.

Referenced by ILIAS\HTTP\RawHTTPServices\__construct().

◆ $durationFactory

ILIAS HTTP Duration DurationFactory ILIAS\HTTP\RawHTTPServices::$durationFactory
private

◆ $request

Psr Http Message ServerRequestInterface ILIAS\HTTP\RawHTTPServices::$request = null
private

◆ $requestFactory

ILIAS HTTP Request RequestFactory ILIAS\HTTP\RawHTTPServices::$requestFactory
private

Definition at line 40 of file RawHTTPServices.php.

Referenced by ILIAS\HTTP\RawHTTPServices\__construct().

◆ $response

Psr Http Message ResponseInterface ILIAS\HTTP\RawHTTPServices::$response = null
private

◆ $responseFactory

ILIAS HTTP Response ResponseFactory ILIAS\HTTP\RawHTTPServices::$responseFactory
private

Definition at line 41 of file RawHTTPServices.php.

Referenced by ILIAS\HTTP\RawHTTPServices\__construct().

◆ $sender

ILIAS HTTP Response Sender ResponseSenderStrategy ILIAS\HTTP\RawHTTPServices::$sender
private

Definition at line 38 of file RawHTTPServices.php.


The documentation for this class was generated from the following file: