ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 (private ResponseSenderStrategy $sender, private CookieJarFactory $cookieJarFactory, private RequestFactory $requestFactory, private ResponseFactory $responseFactory, private DurationFactory $durationFactory)
 RawHTTPServices constructor. More...
 
 durations ()
 
 wrapper ()
 
 cookieJar ()
 @inheritDoc More...
 
 request ()
 @inheritDoc More...
 
 response ()
 @inheritDoc More...
 
 saveRequest (ServerRequestInterface $request)
 @inheritDoc More...
 
 saveResponse (ResponseInterface $response)
 @inheritDoc More...
 
 sendResponse ()
 @inheritDoc More...
 
 close ()
 
 durations ()
 
 wrapper ()
 
 request ()
 Returns the current psr-7 server request. More...
 
 response ()
 Returns the current psr-7 response. More...
 
 cookieJar ()
 Returns a cookie jar which has all cookies known by the ILIAS response. More...
 
 saveRequest (ServerRequestInterface $request)
 Saves the given request for further use. More...
 
 saveResponse (ResponseInterface $response)
 Saves the given response for further use. More...
 
 sendResponse ()
 Render the current response hold by ILIAS. More...
 
 close ()
 

Private Attributes

ServerRequestInterface $request = null
 
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 ( private ResponseSenderStrategy  $sender,
private CookieJarFactory  $cookieJarFactory,
private RequestFactory  $requestFactory,
private ResponseFactory  $responseFactory,
private DurationFactory  $durationFactory 
)

RawHTTPServices constructor.

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

Definition at line 48 of file RawHTTPServices.php.

49 {
50 }

Member Function Documentation

◆ close()

ILIAS\HTTP\RawHTTPServices::close ( )

Implements ILIAS\HTTP\GlobalHttpState.

Definition at line 129 of file RawHTTPServices.php.

129 : void
130 {
131 exit;
132 }
exit

References exit.

◆ cookieJar()

ILIAS\HTTP\RawHTTPServices::cookieJar ( )

@inheritDoc

Implements ILIAS\HTTP\GlobalHttpState.

Definition at line 66 of file RawHTTPServices.php.

66 : CookieJar
67 {
68 return $this->cookieJarFactory->fromResponse($this->response());
69 }

References ILIAS\HTTP\RawHTTPServices\response().

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

+ 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 52 of file RawHTTPServices.php.

53 {
54 return $this->durationFactory;
55 }

◆ request()

ILIAS\HTTP\RawHTTPServices::request ( )

@inheritDoc

Implements ILIAS\HTTP\GlobalHttpState.

Definition at line 75 of file RawHTTPServices.php.

75 : ServerRequestInterface
76 {
77 if ($this->request === null) {
78 $this->request = $this->requestFactory->create();
79 }
80
81 return $this->request;
82 }
ServerRequestInterface $request

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

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ response()

ILIAS\HTTP\RawHTTPServices::response ( )

@inheritDoc

Implements ILIAS\HTTP\GlobalHttpState.

Definition at line 88 of file RawHTTPServices.php.

88 : ResponseInterface
89 {
90 if ($this->response === null) {
91 $this->response = $this->responseFactory->create();
92 }
93
94 return $this->response;
95 }
ResponseInterface $response

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

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveRequest()

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

@inheritDoc

Implements ILIAS\HTTP\GlobalHttpState.

Definition at line 101 of file RawHTTPServices.php.

101 : void
102 {
103 $this->request = $request;
104 }

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

+ Here is the call graph for this function:

◆ saveResponse()

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

@inheritDoc

Implements ILIAS\HTTP\GlobalHttpState.

Definition at line 110 of file RawHTTPServices.php.

110 : void
111 {
112 $this->response = $response;
113 }

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

+ Here is the call graph for this function:

◆ sendResponse()

ILIAS\HTTP\RawHTTPServices::sendResponse ( )

@inheritDoc

Implements ILIAS\HTTP\GlobalHttpState.

Definition at line 119 of file RawHTTPServices.php.

119 : void
120 {
121 // Render Cookies to the response.
122 $response = $this->response();
123 $response = $this->cookieJar()->renderIntoResponseHeader($response);
124
125 $this->sender->sendResponse($response);
126 }

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

+ Here is the call graph for this function:

◆ wrapper()

ILIAS\HTTP\RawHTTPServices::wrapper ( )

Implements ILIAS\HTTP\GlobalHttpState.

Definition at line 57 of file RawHTTPServices.php.

57 : WrapperFactory
58 {
59 return new WrapperFactory($this->request());
60 }

References ILIAS\HTTP\RawHTTPServices\request().

+ Here is the call graph for this function:

Field Documentation

◆ $request

ServerRequestInterface ILIAS\HTTP\RawHTTPServices::$request = null
private

◆ $response

ResponseInterface ILIAS\HTTP\RawHTTPServices::$response = null
private

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