ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilFileDelivery Class Reference

Class ilFileDelivery. More...

+ Inheritance diagram for ilFileDelivery:
+ Collaboration diagram for ilFileDelivery:

Public Member Functions

 __construct (string $file_path)
 ilFileDelivery constructor. More...
 
 __call (string $name, array $arguments)
 Workaround because legacy components try to call methods which are moved to the Deliver class. More...
 

Static Public Member Functions

static deliverFileAttached (string $path_to_file, ?string $download_file_name=null, ?string $mime_type=null, bool $delete_file=false)
 
static streamVideoInline (string $path_to_file, ?string $download_file_name=null)
 
static deliverFileInline (string $path_to_file, ?string $download_file_name=null)
 
static returnASCIIFileName (string $original_filename)
 Converts a UTF-8 filename to ASCII. More...
 
static deliverFileLegacy (string $a_file, ?string $a_filename=null, ?string $a_mime=null, ?bool $isInline=false, ?bool $removeAfterDelivery=false, ?bool $a_exit_after=true)
 
static deliverFileAttached (string $path_to_file, ?string $download_file_name=null, ?string $mime_type=null, bool $delete_file=false)
 
static streamVideoInline (string $path_to_file, ?string $download_file_name=null)
 
static deliverFileInline (string $path_to_file, ?string $download_file_name=null)
 
static returnASCIIFileName (string $original_filename)
 Converts a UTF-8 filename to ASCII. More...
 

Data Fields

const DIRECT_PHP_OUTPUT = Delivery::DIRECT_PHP_OUTPUT
 
const DELIVERY_METHOD_XSENDFILE = DeliveryMethod::XSENDFILE
 
const DELIVERY_METHOD_XACCEL = DeliveryMethod::XACCEL
 
const DELIVERY_METHOD_PHP = DeliveryMethod::PHP
 
const DELIVERY_METHOD_PHP_CHUNKED = DeliveryMethod::PHP_CHUNKED
 
const DISP_ATTACHMENT = Delivery::DISP_ATTACHMENT
 
const DISP_INLINE = Delivery::DISP_INLINE
 

Private Attributes

Delivery $delivery
 

Detailed Description

Class ilFileDelivery.

Author
Fabian Schmid fs@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch
Version
1.0.0

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

Constructor & Destructor Documentation

◆ __construct()

ilFileDelivery::__construct ( string  $file_path)

ilFileDelivery constructor.

Parameters
string$file_path

Definition at line 74 of file class.ilFileDelivery.php.

75 {
76 $this->delivery = new Delivery($file_path, self::http());
77 }
static http()
Fetches the global http state from ILIAS.

References ILIAS\FileDelivery\http().

+ Here is the call graph for this function:

Member Function Documentation

◆ __call()

ilFileDelivery::__call ( string  $name,
array  $arguments 
)

Workaround because legacy components try to call methods which are moved to the Deliver class.

Parameters
string$nameThe function name which was not found on the current object.
array$argumentsThe function arguments passed to the function which was not existent on the current object.

Definition at line 135 of file class.ilFileDelivery.php.

136 {
137 throw new LogicException('');
138 }

◆ deliverFileAttached()

static ilFileDelivery::deliverFileAttached ( string  $path_to_file,
?string  $download_file_name = null,
?string  $mime_type = null,
bool  $delete_file = false 
)
static

Implements ILIAS\FileDelivery\ilFileDeliveryService.

Definition at line 79 of file class.ilFileDelivery.php.

84 : void {
85 $obj = new Delivery($path_to_file, self::http());
86
87 if ($download_file_name !== null) {
88 $obj->setDownloadFileName($download_file_name);
89 }
90 if ($mime_type !== null) {
91 $obj->setMimeType($mime_type);
92 }
93 $obj->setDisposition(self::DISP_ATTACHMENT);
94 $obj->setDeleteFile($delete_file);
95 $obj->deliver();
96 }

References ILIAS\FileDelivery\Delivery\setDownloadFileName().

Referenced by ilPortfolioCertificateFileService\deliverCertificate(), ilSkinStyleContainer\export(), ilDownloadZipInteraction\interaction(), ilCalendarDownloadZipInteraction\interaction(), ilObjBibliographicGUI\sendFile(), and ilExcel\sendToClient().

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

◆ deliverFileInline()

static ilFileDelivery::deliverFileInline ( string  $path_to_file,
?string  $download_file_name = null 
)
static

Implements ILIAS\FileDelivery\ilFileDeliveryService.

Definition at line 110 of file class.ilFileDelivery.php.

113 : void {
114 $obj = new Delivery($path_to_file, self::http());
115 if ($download_file_name !== null) {
116 $obj->setDownloadFileName($download_file_name);
117 }
118 $obj->setDisposition(self::DISP_INLINE);
119 $obj->deliver();
120 }

References ILIAS\FileDelivery\Delivery\setDownloadFileName().

+ Here is the call graph for this function:

◆ deliverFileLegacy()

static ilFileDelivery::deliverFileLegacy ( string  $a_file,
?string  $a_filename = null,
?string  $a_mime = null,
?bool  $isInline = false,
?bool  $removeAfterDelivery = false,
?bool  $a_exit_after = true 
)
static
Deprecated:

Definition at line 143 of file class.ilFileDelivery.php.

150 : void {
151 global $DIC;
152 // should we fail silently?
153 if (!file_exists($a_file)) {
154 return;
155 }
156 $delivery = new Delivery($a_file, $DIC->http());
157
158 if ($isInline) {
159 $delivery->setDisposition(self::DISP_INLINE);
160 } else {
161 $delivery->setDisposition(self::DISP_ATTACHMENT);
162 }
163
164 if ($a_mime !== null && $a_mime !== '') {
165 $delivery->setMimeType($a_mime);
166 }
167
168 $settings = new General();
169 $delivery->setDownloadFileName($a_filename);
170 $delivery->setConvertFileNameToAsci($settings->isDownloadWithAsciiFileName());
171 $delivery->setDeleteFile($removeAfterDelivery);
172 $delivery->setExitAfter($a_exit_after);
174 }
setExitAfter(bool $exit_after)
Definition: Delivery.php:345
setConvertFileNameToAsci(bool $convert_file_name_to_asci)
Definition: Delivery.php:357
setMimeType(string $mime_type)
Definition: Delivery.php:285
setDisposition(string $disposition)
Definition: Delivery.php:321
setDeleteFile(bool $delete_file)
Definition: Delivery.php:548
setDownloadFileName(string $download_file_name)
Definition: Delivery.php:309
global $DIC
Definition: shib_login.php:26

Referenced by ilObjCmiXapiVerificationGUI\deliver(), ilObjCourseVerificationGUI\deliver(), ilObjExerciseVerificationGUI\deliver(), ilObjLTIConsumerVerificationGUI\deliver(), ilObjSCORMVerificationGUI\deliver(), ilObjTestVerificationGUI\deliver(), ilMailFolderGUI\deliverAttachments(), ilMailFolderGUI\deliverFile(), ilBlogExerciseGUI\downloadExcAssFile(), ilPortfolioExerciseGUI\downloadExcAssFile(), ilObjSurveyQuestionPoolGUI\downloadExportFileObject(), ilObjUserFolderGUI\downloadExportFileObject(), ilFileSystemGUI\downloadFile(), ilSAHSEditGUI\executeCommand(), ILIAS\Notes\Export\NotesHtmlExport\exportHTML(), ilPageLayoutAdministrationGUI\exportLayout(), ilObjQuestionPoolGUI\exportQuestions(), ilObjStyleSheetGUI\exportStyleObject(), ILIAS\Export\ExportHandler\Consumer\ExportOption\BasicLegacyHandler\onDownloadFiles(), ilMediaPoolExportOptionXMLMaster\onDownloadFiles(), ilMediaPoolExportOptionXMLMasterNoMedia\onDownloadFiles(), ilTestExportOptionARC\onDownloadFiles(), ilOrgUnitExporter\sendAndCreateSimpleExportFile(), ilDclRecordListGUI\sendFile(), ilObjCourseGUI\sendFileObject(), ilObjUser\sendPersonalDataFile(), ilObjUserFolderGUI\usrExportCsvObject(), ilObjUserFolderGUI\usrExportX86Object(), ilObjUserFolderGUI\usrExportXmlObject(), and ilUserCertificateZip\zipCertificatesInArchiveDirectory().

+ Here is the caller graph for this function:

◆ returnASCIIFileName()

static ilFileDelivery::returnASCIIFileName ( string  $original_filename)
static

Converts a UTF-8 filename to ASCII.

Implements ILIAS\FileDelivery\ilFileDeliveryService.

Definition at line 122 of file class.ilFileDelivery.php.

122 : string
123 {
124 return Delivery::returnASCIIFileName($original_filename);
125 }

◆ streamVideoInline()

static ilFileDelivery::streamVideoInline ( string  $path_to_file,
?string  $download_file_name = null 
)
static

Implements ILIAS\FileDelivery\ilFileDeliveryService.

Definition at line 98 of file class.ilFileDelivery.php.

101 : void {
102 $obj = new Delivery($path_to_file, self::http());
103 if ($download_file_name !== null) {
104 $obj->setDownloadFileName($download_file_name);
105 }
106 $obj->setDisposition(self::DISP_INLINE);
107 $obj->stream();
108 }

References ILIAS\FileDelivery\Delivery\setDownloadFileName().

+ Here is the call graph for this function:

Field Documentation

◆ $delivery

Delivery ilFileDelivery::$delivery
private

Definition at line 67 of file class.ilFileDelivery.php.

◆ DELIVERY_METHOD_PHP

const ilFileDelivery::DELIVERY_METHOD_PHP = DeliveryMethod::PHP

Definition at line 54 of file class.ilFileDelivery.php.

◆ DELIVERY_METHOD_PHP_CHUNKED

const ilFileDelivery::DELIVERY_METHOD_PHP_CHUNKED = DeliveryMethod::PHP_CHUNKED

Definition at line 58 of file class.ilFileDelivery.php.

◆ DELIVERY_METHOD_XACCEL

const ilFileDelivery::DELIVERY_METHOD_XACCEL = DeliveryMethod::XACCEL

Definition at line 50 of file class.ilFileDelivery.php.

◆ DELIVERY_METHOD_XSENDFILE

const ilFileDelivery::DELIVERY_METHOD_XSENDFILE = DeliveryMethod::XSENDFILE

Definition at line 46 of file class.ilFileDelivery.php.

◆ DIRECT_PHP_OUTPUT

const ilFileDelivery::DIRECT_PHP_OUTPUT = Delivery::DIRECT_PHP_OUTPUT

Definition at line 42 of file class.ilFileDelivery.php.

Referenced by ilPHPOutputDelivery\start().

◆ DISP_ATTACHMENT

const ilFileDelivery::DISP_ATTACHMENT = Delivery::DISP_ATTACHMENT

Definition at line 62 of file class.ilFileDelivery.php.

Referenced by ilPHPOutputDelivery\start().

◆ DISP_INLINE

const ilFileDelivery::DISP_INLINE = Delivery::DISP_INLINE

Definition at line 66 of file class.ilFileDelivery.php.


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