ILIAS  trunk Revision v5.2.0beta1-34132-g2d4d73d4a0
ILIAS\FileDelivery\FileDeliveryTypes\PHP Class Reference

Class PHP. More...

+ Inheritance diagram for ILIAS\FileDelivery\FileDeliveryTypes\PHP:
+ Collaboration diagram for ILIAS\FileDelivery\FileDeliveryTypes\PHP:

Public Member Functions

 __construct (Services $httpState)
 PHP constructor. More...
 
 doesFileExists (string $path_to_file)
 
 prepare (string $path_to_file, ?FileStream $possible_stream)
 
 deliver (string $path_to_file, bool $file_marked_to_delete)
 
Parameters
string$path_to_fileabsolute path to file
bool$file_marked_to_deleteThis is needed at this point for header-based delivery methods
Returns
void
More...
 
 supportsInlineDelivery ()
 
 supportsAttachmentDelivery ()
 
 supportsStreaming ()
 
 handleFileDeletion (string $path_to_file)
 
Parameters
string$path_to_file
Returns
bool
More...
 
- Public Member Functions inherited from ILIAS\FileDelivery\ilFileDeliveryType
 prepare (string $path_to_file, ?FileStream $possible_stream)
 

Protected Attributes

 $file
 
ILIAS HTTP Services $httpService
 

Detailed Description

Class PHP.

Author
Fabian Schmid fs@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch
Since
5.3
Version
1.0

Definition at line 36 of file PHP.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\FileDelivery\FileDeliveryTypes\PHP::__construct ( Services  $httpState)

PHP constructor.

Parameters
Services$httpState

Definition at line 50 of file PHP.php.

51  {
52  $this->httpService = $httpState;
53  }

Member Function Documentation

◆ deliver()

ILIAS\FileDelivery\FileDeliveryTypes\PHP::deliver ( string  $path_to_file,
bool  $file_marked_to_delete 
)

Parameters
string$path_to_fileabsolute path to file
bool$file_marked_to_deleteThis is needed at this point for header-based delivery methods
Returns
void

Implements ILIAS\FileDelivery\ilFileDeliveryType.

Definition at line 83 of file PHP.php.

83  : void
84  {
85  $this->httpService->sendResponse();
86  fpassthru($this->file);
87  // Fix for mantis 22594
88  fclose($this->file);
89  }

◆ doesFileExists()

ILIAS\FileDelivery\FileDeliveryTypes\PHP::doesFileExists ( string  $path_to_file)

Implements ILIAS\FileDelivery\ilFileDeliveryType.

Definition at line 59 of file PHP.php.

59  : bool
60  {
61  return is_readable($path_to_file);
62  }

◆ handleFileDeletion()

ILIAS\FileDelivery\FileDeliveryTypes\PHP::handleFileDeletion ( string  $path_to_file)

Parameters
string$path_to_file
Returns
bool

Implements ILIAS\FileDelivery\ilFileDeliveryType.

Definition at line 122 of file PHP.php.

122  : bool
123  {
124  return unlink($path_to_file);
125  }

◆ prepare()

ILIAS\FileDelivery\FileDeliveryTypes\PHP::prepare ( string  $path_to_file,
?FileStream  $possible_stream 
)

Definition at line 68 of file PHP.php.

68  : bool
69  {
70  set_time_limit(0);
71  if ($possible_stream !== null) {
72  $this->file = $possible_stream->detach();
73  } else {
74  $this->file = fopen($path_to_file, 'rb');
75  }
76  return true;
77  }

◆ supportsAttachmentDelivery()

ILIAS\FileDelivery\FileDeliveryTypes\PHP::supportsAttachmentDelivery ( )

Implements ILIAS\FileDelivery\ilFileDeliveryType.

Definition at line 104 of file PHP.php.

104  : bool
105  {
106  return true;
107  }

◆ supportsInlineDelivery()

ILIAS\FileDelivery\FileDeliveryTypes\PHP::supportsInlineDelivery ( )

Implements ILIAS\FileDelivery\ilFileDeliveryType.

Definition at line 95 of file PHP.php.

95  : bool
96  {
97  return true;
98  }

◆ supportsStreaming()

ILIAS\FileDelivery\FileDeliveryTypes\PHP::supportsStreaming ( )

Implements ILIAS\FileDelivery\ilFileDeliveryType.

Definition at line 113 of file PHP.php.

113  : bool
114  {
115  return false;
116  }

Field Documentation

◆ $file

ILIAS\FileDelivery\FileDeliveryTypes\PHP::$file
protected

Definition at line 41 of file PHP.php.

◆ $httpService

ILIAS HTTP Services ILIAS\FileDelivery\FileDeliveryTypes\PHP::$httpService
protected

Definition at line 42 of file PHP.php.


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