ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ILIAS\DI\HTTPServices Class Reference

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

+ Inheritance diagram for ILIAS\DI\HTTPServices:
+ Collaboration diagram for ILIAS\DI\HTTPServices:

Public Member Functions

 __construct (ResponseSenderStrategy $senderStrategy, CookieJarFactory $cookieJarFactory, RequestFactory $requestFactory, ResponseFactory $responseFactory)
 HTTPServices constructor. More...
 
 cookieJar ()
 @inheritDoc More...
 
 request ()
 @inheritDoc More...
 
 response ()
 @inheritDoc More...
 
 saveRequest (ServerRequestInterface $request)
 @inheritDoc More...
 
 saveResponse (ResponseInterface $response)
 @inheritDoc More...
 
 sendResponse ()
 @inheritDoc More...
 
 close ()
 
 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

 $sender
 
 $cookieJarFactory
 
 $requestFactory
 
 $responseFactory
 
 $request
 
 $response
 

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 20 of file HTTPServices.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\DI\HTTPServices::__construct ( ResponseSenderStrategy  $senderStrategy,
CookieJarFactory  $cookieJarFactory,
RequestFactory  $requestFactory,
ResponseFactory  $responseFactory 
)

HTTPServices constructor.

Parameters
ResponseSenderStrategy$senderStrategyA response sender strategy.
CookieJarFactory$cookieJarFactoryCookie Jar implementation.
RequestFactory$requestFactory
ResponseFactory$responseFactory

Definition at line 57 of file HTTPServices.php.

58 {
59 $this->sender = $senderStrategy;
60 $this->cookieJarFactory = $cookieJarFactory;
61
62 $this->requestFactory = $requestFactory;
63 $this->responseFactory = $responseFactory;
64 }

References ILIAS\DI\HTTPServices\$cookieJarFactory, ILIAS\DI\HTTPServices\$requestFactory, and ILIAS\DI\HTTPServices\$responseFactory.

Member Function Documentation

◆ close()

ILIAS\DI\HTTPServices::close ( )

Implements ILIAS\HTTP\GlobalHttpState.

Definition at line 129 of file HTTPServices.php.

129 : void
130 {
131 exit;
132 }
exit
Definition: login.php:29

References exit.

◆ cookieJar()

ILIAS\DI\HTTPServices::cookieJar ( )

@inheritDoc

Implements ILIAS\HTTP\GlobalHttpState.

Definition at line 70 of file HTTPServices.php.

70 : CookieJar
71 {
72 return $this->cookieJarFactory->fromResponse($this->response());
73 }
response()
@inheritDoc

References ILIAS\DI\HTTPServices\response().

+ Here is the call graph for this function:

◆ request()

ILIAS\DI\HTTPServices::request ( )

@inheritDoc

Implements ILIAS\HTTP\GlobalHttpState.

Definition at line 79 of file HTTPServices.php.

79 : \Psr\Http\Message\RequestInterface
80 {
81 if ($this->request === null) {
82 $this->request = $this->requestFactory->create();
83 }
84
85 return $this->request;
86 }
request()
@inheritDoc

References ILIAS\DI\HTTPServices\$request, and ILIAS\DI\HTTPServices\request().

Referenced by ILIAS\DI\HTTPServices\request(), and ILIAS\DI\HTTPServices\saveRequest().

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

◆ response()

ILIAS\DI\HTTPServices::response ( )

@inheritDoc

Implements ILIAS\HTTP\GlobalHttpState.

Definition at line 92 of file HTTPServices.php.

92 : ResponseInterface
93 {
94 if ($this->response === null) {
95 $this->response = $this->responseFactory->create();
96 }
97
98 return $this->response;
99 }

References ILIAS\DI\HTTPServices\$response, and ILIAS\DI\HTTPServices\response().

Referenced by ILIAS\DI\HTTPServices\cookieJar(), ILIAS\DI\HTTPServices\response(), ILIAS\DI\HTTPServices\saveResponse(), and ILIAS\DI\HTTPServices\sendResponse().

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

◆ saveRequest()

ILIAS\DI\HTTPServices::saveRequest ( ServerRequestInterface  $request)

@inheritDoc

Implements ILIAS\HTTP\GlobalHttpState.

Definition at line 105 of file HTTPServices.php.

105 : void
106 {
107 $this->request = $request;
108 }

References ILIAS\DI\HTTPServices\$request, and ILIAS\DI\HTTPServices\request().

+ Here is the call graph for this function:

◆ saveResponse()

ILIAS\DI\HTTPServices::saveResponse ( ResponseInterface  $response)

@inheritDoc

Implements ILIAS\HTTP\GlobalHttpState.

Definition at line 114 of file HTTPServices.php.

114 : void
115 {
116 $this->response = $response;
117 }

References ILIAS\DI\HTTPServices\$response, and ILIAS\DI\HTTPServices\response().

+ Here is the call graph for this function:

◆ sendResponse()

ILIAS\DI\HTTPServices::sendResponse ( )

@inheritDoc

Implements ILIAS\HTTP\GlobalHttpState.

Definition at line 123 of file HTTPServices.php.

123 : void
124 {
125 $this->sender->sendResponse($this->response());
126 }

References ILIAS\DI\HTTPServices\response().

+ Here is the call graph for this function:

Field Documentation

◆ $cookieJarFactory

CookieJarFactory ILIAS\DI\HTTPServices::$cookieJarFactory
private

Definition at line 30 of file HTTPServices.php.

Referenced by ILIAS\DI\HTTPServices\__construct().

◆ $request

ServerRequestInterface ILIAS\DI\HTTPServices::$request
private

◆ $requestFactory

RequestFactory ILIAS\DI\HTTPServices::$requestFactory
private

Definition at line 34 of file HTTPServices.php.

Referenced by ILIAS\DI\HTTPServices\__construct().

◆ $response

ResponseInterface ILIAS\DI\HTTPServices::$response
private

◆ $responseFactory

ResponseFactory ILIAS\DI\HTTPServices::$responseFactory
private

Definition at line 38 of file HTTPServices.php.

Referenced by ILIAS\DI\HTTPServices\__construct().

◆ $sender

ILIAS\DI\HTTPServices::$sender
private

Definition at line 26 of file HTTPServices.php.


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