ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
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)
 

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 31 of file class.ilFileDelivery.php.

Constructor & Destructor Documentation

◆ __construct()

ilFileDelivery::__construct ( string  $file_path)

ilFileDelivery constructor.

Parameters
string$file_path

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

References ILIAS\FileDelivery\http().

50  {
51  $this->delivery = new Delivery($file_path, self::http());
52  }
static http()
Fetches the global http state from ILIAS.
Class Delivery.
Definition: Delivery.php:37
+ 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 110 of file class.ilFileDelivery.php.

111  {
112  throw new LogicException('');
113  }

◆ 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 54 of file class.ilFileDelivery.php.

References ILIAS\FileDelivery\http().

Referenced by ilFileDataMail\deliverAttachmentsAsZip(), ilPortfolioCertificateFileService\deliverCertificate(), ilSkinStyleContainer\export(), ILIAS\MediaCast\BackgroundTasks\DownloadAllZipInteraction\interaction(), ilCalendarDownloadZipInteraction\interaction(), ilExDownloadSubmissionsZipInteraction\interaction(), ilDownloadZipInteraction\interaction(), ilDclRecordListGUI\sendFile(), ilObjBibliographicGUI\sendFile(), and ilExcel\sendToClient().

59  : void {
60  $obj = new Delivery($path_to_file, self::http());
61 
62  if ($download_file_name !== null) {
63  $obj->setDownloadFileName($download_file_name);
64  }
65  if ($mime_type !== null) {
66  $obj->setMimeType($mime_type);
67  }
68  $obj->setDisposition(self::DISP_ATTACHMENT);
69  $obj->setDeleteFile($delete_file);
70  $obj->deliver();
71  }
static http()
Fetches the global http state from ILIAS.
Class Delivery.
Definition: Delivery.php:37
+ 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 85 of file class.ilFileDelivery.php.

References ILIAS\FileDelivery\http().

88  : void {
89  $obj = new Delivery($path_to_file, self::http());
90  if ($download_file_name !== null) {
91  $obj->setDownloadFileName($download_file_name);
92  }
93  $obj->setDisposition(self::DISP_INLINE);
94  $obj->deliver();
95  }
static http()
Fetches the global http state from ILIAS.
Class Delivery.
Definition: Delivery.php:37
+ 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 118 of file class.ilFileDelivery.php.

References $DIC, ILIAS\FileDelivery\Delivery\deliver(), ILIAS\FileDelivery\Delivery\setConvertFileNameToAsci(), ILIAS\FileDelivery\Delivery\setDeleteFile(), ILIAS\FileDelivery\Delivery\setDisposition(), ILIAS\FileDelivery\Delivery\setDownloadFileName(), ILIAS\FileDelivery\Delivery\setExitAfter(), and ILIAS\FileDelivery\Delivery\setMimeType().

Referenced by ilObjExerciseVerificationGUI\deliver(), ilObjCmiXapiVerificationGUI\deliver(), ilObjLTIConsumerVerificationGUI\deliver(), ilObjSCORMVerificationGUI\deliver(), ilObjTestVerificationGUI\deliver(), ilObjCourseVerificationGUI\deliver(), ilMailFolderGUI\deliverAttachments(), ilCertificateUtilHelper\deliverFile(), ilWikiUserHTMLExport\deliverFile(), ilFileDataForumDrafts\deliverFile(), ilFileDataForum\deliverFile(), ilMailFolderGUI\deliverFile(), assFileUpload\deliverFileUploadZIPFile(), ilBookingObjectGUI\deliverInfo(), ilNewsItem\deliverMobFile(), ilHtmlToPdfTransformerFactory\deliverPDF(), ilBookingProcessGUI\deliverPostFile(), ilFileDataForumDrafts\deliverZipFile(), ilFileDataForum\deliverZipFile(), ilExportGUI\download(), ilBlogExerciseGUI\downloadExcAssFile(), ilPortfolioExerciseGUI\downloadExcAssFile(), ilBlogExerciseGUI\downloadExcSubFile(), ilPortfolioExerciseGUI\downloadExcSubFile(), ilWikiPageGUI\downloadExcSubFile(), ilGlossaryPresentationGUI\downloadExportFile(), ilLMPresentationGUI\downloadExportFile(), ilObjSurveyQuestionPoolGUI\downloadExportFileObject(), ilObjUserFolderGUI\downloadExportFileObject(), ilExSubmissionGUI\downloadFeedbackFileObject(), ilIndividualAssessmentMemberGUI\downloadFile(), ilAdvancedMDSettingsGUI\downloadFile(), ilFileSystemGUI\downloadFile(), ilObjIndividualAssessmentGUI\downloadFileObject(), ilExSubmissionGUI\downloadFileObject(), ilExSubmissionGUI\downloadGlobalFeedbackFileObject(), ilExAssignmentEditorGUI\downloadGlobalFeedbackFileObject(), ilExSubmission\downloadMultipleFiles(), ilExPeerReviewGUI\downloadPeerReviewObject(), ilExSubmission\downloadSingleFile(), ilSAHSEditGUI\executeCommand(), ilObjPortfolioBaseGUI\export(), ilObjBlogGUI\export(), ILIAS\Notes\Export\NotesHtmlExport\exportHTML(), ilPageLayoutAdministrationGUI\exportLayout(), ilObjQuestionPoolGUI\exportQuestionObject(), ilObjStyleSheetGUI\exportStyleObject(), ilTestExportGUI\getExportTypeFromFileName(), ilOrgUnitExporter\sendAndCreateSimpleExportFile(), ilObjSessionGUI\sendFileObject(), ilObjCourseGUI\sendFileObject(), ilExAssignment\sendMultiFeedbackStructureFile(), ilObjUser\sendPersonalDataFile(), ilObjUserFolderGUI\usrExportCsvObject(), ilObjUserFolderGUI\usrExportX86Object(), ilObjUserFolderGUI\usrExportXmlObject(), and ilUserCertificateZip\zipCertificatesInArchiveDirectory().

125  : void {
126  global $DIC;
127  // should we fail silently?
128  if (!file_exists($a_file)) {
129  return;
130  }
131  $delivery = new Delivery($a_file, $DIC->http());
132 
133  if ($isInline) {
134  $delivery->setDisposition(self::DISP_INLINE);
135  } else {
136  $delivery->setDisposition(self::DISP_ATTACHMENT);
137  }
138 
139  if ($a_mime !== null && $a_mime !== '') {
140  $delivery->setMimeType($a_mime);
141  }
142 
143  $delivery->setDownloadFileName($a_filename);
144  $delivery->setConvertFileNameToAsci((bool) !$DIC->clientIni()->readVariable('file_access', 'disable_ascii'));
145  $delivery->setDeleteFile($removeAfterDelivery);
146  $delivery->setExitAfter($a_exit_after);
147  $delivery->deliver();
148  }
setConvertFileNameToAsci(bool $convert_file_name_to_asci)
Definition: Delivery.php:332
setDeleteFile(bool $delete_file)
Definition: Delivery.php:523
setMimeType(string $mime_type)
Definition: Delivery.php:260
global $DIC
Definition: feed.php:28
setDisposition(string $disposition)
Definition: Delivery.php:296
setExitAfter(bool $exit_after)
Definition: Delivery.php:320
setDownloadFileName(string $download_file_name)
Definition: Delivery.php:284
Class Delivery.
Definition: Delivery.php:37
+ Here is the call graph for this function:
+ 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 97 of file class.ilFileDelivery.php.

97  : string
98  {
99  return Delivery::returnASCIIFileName($original_filename);
100  }

◆ streamVideoInline()

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

Implements ILIAS\FileDelivery\ilFileDeliveryService.

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

References ILIAS\FileDelivery\http().

76  : void {
77  $obj = new Delivery($path_to_file, self::http());
78  if ($download_file_name !== null) {
79  $obj->setDownloadFileName($download_file_name);
80  }
81  $obj->setDisposition(self::DISP_INLINE);
82  $obj->stream();
83  }
static http()
Fetches the global http state from ILIAS.
Class Delivery.
Definition: Delivery.php:37
+ Here is the call graph for this function:

Field Documentation

◆ $delivery

Delivery ilFileDelivery::$delivery
private

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

◆ DELIVERY_METHOD_PHP

const ilFileDelivery::DELIVERY_METHOD_PHP = DeliveryMethod::PHP

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

◆ DELIVERY_METHOD_PHP_CHUNKED

const ilFileDelivery::DELIVERY_METHOD_PHP_CHUNKED = DeliveryMethod::PHP_CHUNKED

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

◆ DELIVERY_METHOD_XACCEL

const ilFileDelivery::DELIVERY_METHOD_XACCEL = DeliveryMethod::XACCEL

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

◆ DELIVERY_METHOD_XSENDFILE

const ilFileDelivery::DELIVERY_METHOD_XSENDFILE = DeliveryMethod::XSENDFILE

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

◆ DIRECT_PHP_OUTPUT

const ilFileDelivery::DIRECT_PHP_OUTPUT = Delivery::DIRECT_PHP_OUTPUT

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

Referenced by ilPHPOutputDelivery\start().

◆ DISP_ATTACHMENT

const ilFileDelivery::DISP_ATTACHMENT = Delivery::DISP_ATTACHMENT

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

Referenced by ilPHPOutputDelivery\start().

◆ DISP_INLINE

const ilFileDelivery::DISP_INLINE = Delivery::DISP_INLINE

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


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