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 ()
 
 request ()
 
 response ()
 
 saveRequest (ServerRequestInterface $request)
 
 saveResponse (ResponseInterface $response)
 
 sendResponse ()
 
 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.

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

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

Member Function Documentation

◆ close()

ILIAS\DI\HTTPServices::close ( )

Implements ILIAS\HTTP\GlobalHttpState.

Definition at line 129 of file HTTPServices.php.

References exit.

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

◆ cookieJar()

ILIAS\DI\HTTPServices::cookieJar ( )

Implements ILIAS\HTTP\GlobalHttpState.

Definition at line 70 of file HTTPServices.php.

References ILIAS\DI\HTTPServices\response().

70  : CookieJar
71  {
72  return $this->cookieJarFactory->fromResponse($this->response());
73  }
+ Here is the call graph for this function:

◆ request()

ILIAS\DI\HTTPServices::request ( )

Implements ILIAS\HTTP\GlobalHttpState.

Definition at line 79 of file HTTPServices.php.

References ILIAS\DI\HTTPServices\$request.

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

79  : \Psr\Http\Message\RequestInterface
80  {
81  if ($this->request === null) {
82  $this->request = $this->requestFactory->create();
83  }
84 
85  return $this->request;
86  }
+ Here is the caller graph for this function:

◆ response()

ILIAS\DI\HTTPServices::response ( )

Implements ILIAS\HTTP\GlobalHttpState.

Definition at line 92 of file HTTPServices.php.

References ILIAS\DI\HTTPServices\$response.

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

92  : ResponseInterface
93  {
94  if ($this->response === null) {
95  $this->response = $this->responseFactory->create();
96  }
97 
98  return $this->response;
99  }
+ Here is the caller graph for this function:

◆ saveRequest()

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

Implements ILIAS\HTTP\GlobalHttpState.

Definition at line 105 of file HTTPServices.php.

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

105  : void
106  {
107  $this->request = $request;
108  }
+ Here is the call graph for this function:

◆ saveResponse()

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

Implements ILIAS\HTTP\GlobalHttpState.

Definition at line 114 of file HTTPServices.php.

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

114  : void
115  {
116  $this->response = $response;
117  }
+ Here is the call graph for this function:

◆ sendResponse()

ILIAS\DI\HTTPServices::sendResponse ( )

Implements ILIAS\HTTP\GlobalHttpState.

Definition at line 123 of file HTTPServices.php.

References ILIAS\DI\HTTPServices\response().

123  : void
124  {
125  $this->sender->sendResponse($this->response());
126  }
+ 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: