ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\Repository\HTTP\HTTPUtil Class Reference
+ Collaboration diagram for ILIAS\Repository\HTTP\HTTPUtil:

Public Member Functions

 __construct (HTTP\Services $http)
 
 sendString (string $output)
 
 deliverString (string $data, string $filename, string $mime="application/octet-stream")
 
 deliverStream (FileStream $stream, string $filename, string $mime="application/octet-stream")
 

Protected Attributes

HTTP Services $http
 

Detailed Description

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 31 of file class.HTTPUtil.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Repository\HTTP\HTTPUtil::__construct ( HTTP\Services  $http)

Definition at line 35 of file class.HTTPUtil.php.

References ILIAS\Repository\HTTP\HTTPUtil\$http, and ILIAS\Repository\http().

+ Here is the call graph for this function:

Member Function Documentation

◆ deliverStream()

ILIAS\Repository\HTTP\HTTPUtil::deliverStream ( FileStream  $stream,
string  $filename,
string  $mime = "application/octet-stream" 
)

Definition at line 68 of file class.HTTPUtil.php.

72 : void {
73 $delivery = new Delivery(
75 $this->http
76 );
77 $delivery->setMimeType($mime);
78 $delivery->setSendMimeType(true);
79 $delivery->setDisposition(Delivery::DISP_ATTACHMENT);
80 $delivery->setDownloadFileName($filename);
81 $delivery->setConvertFileNameToAsci(true);
82 $repsonse = $this->http->response()->withBody($stream);
83 $this->http->saveResponse($repsonse);
84 $delivery->deliver();
85 }
$filename
Definition: buildRTE.php:78

◆ deliverString()

ILIAS\Repository\HTTP\HTTPUtil::deliverString ( string  $data,
string  $filename,
string  $mime = "application/octet-stream" 
)

Definition at line 49 of file class.HTTPUtil.php.

53 : void {
54 $delivery = new Delivery(
56 $this->http
57 );
58 $delivery->setMimeType($mime);
59 $delivery->setSendMimeType(true);
60 $delivery->setDisposition(Delivery::DISP_ATTACHMENT);
61 $delivery->setDownloadFileName($filename);
62 $delivery->setConvertFileNameToAsci(true);
63 $repsonse = $this->http->response()->withBody(Streams::ofString($data));
64 $this->http->saveResponse($repsonse);
65 $delivery->deliver();
66 }
static ofString(string $string)
Creates a new stream with an initial value.
Definition: Streams.php:41

◆ sendString()

ILIAS\Repository\HTTP\HTTPUtil::sendString ( string  $output)

Definition at line 40 of file class.HTTPUtil.php.

40 : void
41 {
42 $this->http->saveResponse($this->http->response()->withBody(
43 Streams::ofString($output)
44 ));
45 $this->http->sendResponse();
46 $this->http->close();
47 }

References ILIAS\Repository\http(), and ILIAS\Filesystem\Stream\Streams\ofString().

+ Here is the call graph for this function:

Field Documentation

◆ $http

HTTP Services ILIAS\Repository\HTTP\HTTPUtil::$http
protected

Definition at line 33 of file class.HTTPUtil.php.

Referenced by ILIAS\Repository\HTTP\HTTPUtil\__construct().


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