ILIAS  release_8 Revision v8.24
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 ()
 @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

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.

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

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

Member Function Documentation

◆ close()

ILIAS\HTTP\RawHTTPServices::close ( )

Implements ILIAS\HTTP\GlobalHttpState.

Definition at line 144 of file RawHTTPServices.php.

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

References exit.

◆ cookieJar()

ILIAS\HTTP\RawHTTPServices::cookieJar ( )

@inheritDoc

Implements ILIAS\HTTP\GlobalHttpState.

Definition at line 81 of file RawHTTPServices.php.

81 : CookieJar
82 {
83 return $this->cookieJarFactory->fromResponse($this->response());
84 }

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 ( )

◆ request()

ILIAS\HTTP\RawHTTPServices::request ( )

@inheritDoc

Implements ILIAS\HTTP\GlobalHttpState.

Definition at line 90 of file RawHTTPServices.php.

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

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

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

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

116 : void
117 {
118 $this->request = $request;
119 }

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

125 : void
126 {
127 $this->response = $response;
128 }

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

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 }

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

72 : WrapperFactory
73 {
74 return new WrapperFactory($this->request());
75 }

References ILIAS\HTTP\RawHTTPServices\request().

+ 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: