ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 ()
 Creates a new cookie jar from the current known request. More...
 
 request ()
 
 response ()
 
 saveRequest (ServerRequestInterface $request)
 
 saveResponse (ResponseInterface $response)
 
 sendResponse ()
 

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

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

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

Member Function Documentation

◆ cookieJar()

ILIAS\DI\HTTPServices::cookieJar ( )

Creates a new cookie jar from the current known request.

Returns

Implements ILIAS\HTTP\GlobalHttpState.

Definition at line 71 of file HTTPServices.php.

References ILIAS\DI\HTTPServices\response().

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

◆ request()

ILIAS\DI\HTTPServices::request ( )

Implements ILIAS\HTTP\GlobalHttpState.

Definition at line 80 of file HTTPServices.php.

References ILIAS\DI\HTTPServices\$request.

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

81  {
82  if ($this->request === null) {
83  $this->request = $this->requestFactory->create();
84  }
85 
86  return $this->request;
87  }
+ Here is the caller graph for this function:

◆ response()

ILIAS\DI\HTTPServices::response ( )

Implements ILIAS\HTTP\GlobalHttpState.

Definition at line 93 of file HTTPServices.php.

References ILIAS\DI\HTTPServices\$response.

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

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

◆ saveRequest()

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

Implements ILIAS\HTTP\GlobalHttpState.

Definition at line 106 of file HTTPServices.php.

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

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

◆ saveResponse()

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

Implements ILIAS\HTTP\GlobalHttpState.

Definition at line 115 of file HTTPServices.php.

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

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

◆ sendResponse()

ILIAS\DI\HTTPServices::sendResponse ( )

Implements ILIAS\HTTP\GlobalHttpState.

Definition at line 124 of file HTTPServices.php.

References ILIAS\DI\HTTPServices\response().

125  {
126  $this->sender->sendResponse($this->response());
127  }
+ Here is the call graph for this function:

Field Documentation

◆ $cookieJarFactory

CookieJarFactory ILIAS\DI\HTTPServices::$cookieJarFactory
private

Definition at line 29 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 33 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 37 of file HTTPServices.php.

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

◆ $sender

ILIAS\DI\HTTPServices::$sender
private

Definition at line 25 of file HTTPServices.php.


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