ILIAS  release_7 Revision v7.30-3-g800a261c036
PHP.php
Go to the documentation of this file.
1<?php
2
4
7
8require_once('./Services/FileDelivery/interfaces/int.ilFileDeliveryType.php');
9
19final class PHP implements ilFileDeliveryType
20{
21
25 protected $file;
29 protected $httpService;
30
31
37 public function __construct(GlobalHttpState $httpState)
38 {
39 $this->httpService = $httpState;
40 }
41
42
46 public function doesFileExists($path_to_file)
47 {
48 return is_readable($path_to_file);
49 }
50
51
55 public function prepare($path_to_file)
56 {
57 set_time_limit(0);
58 $this->file = fopen($path_to_file, "rb");
59 }
60
61
65 public function deliver($path_to_file, $file_marked_to_delete)
66 {
67 $this->httpService->sendResponse();
68 fpassthru($this->file);
69 // Fix for mantis 22594
70 fclose($this->file);
71 }
72
73
77 public function supportsInlineDelivery()
78 {
79 return true;
80 }
81
82
87 {
88 return true;
89 }
90
91
95 public function supportsStreaming()
96 {
97 return false;
98 }
99
100
104 public function handleFileDeletion($path_to_file)
105 {
106 return unlink($path_to_file);
107 }
108}
An exception for terminatinating execution or to throw for unit testing.
doesFileExists($path_to_file)
@inheritDoc
Definition: PHP.php:46
deliver($path_to_file, $file_marked_to_delete)
bool
Definition: PHP.php:65
__construct(GlobalHttpState $httpState)
PHP constructor.
Definition: PHP.php:37
handleFileDeletion($path_to_file)
bool
Definition: PHP.php:104
Interface GlobalHttpState.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...