ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
ilFileDataMail Class Reference
+ Inheritance diagram for ilFileDataMail:
+ Collaboration diagram for ilFileDataMail:

Public Member Functions

 __construct (public int $user_id=0)
 
 initDirectory ()
 
 getUploadLimit ()
 
 getAttachmentsTotalSizeLimit ()
 
 getMailPath ()
 
 getAbsoluteAttachmentPoolPathPrefix ()
 
 getAttachmentPathAndFilenameByMd5Hash (string $md5FileHash, int $mail_id)
 
 getAttachmentPath (string $a_filename, int $a_mail_id)
 
 adoptAttachments (array $a_attachments, int $a_mail_id)
 
 checkReadWrite ()
 
 getUserFilesData ()
 
 storeAsAttachment (string $a_filename, string $a_content)
 
 storeUploadedFile (UploadResult $result)
 
 copyAttachmentFile (string $a_abs_path, string $a_new_name)
 
 unlinkFiles (array $a_filenames)
 
 unlinkFile (string $a_filename)
 
 getAbsoluteAttachmentPoolPathByFilename (string $filename)
 Resolves a path for a passed filename in regards of a user's mail attachment pool, meaning attachments not being sent. More...
 
 saveFiles (int $a_mail_id, array $a_attachments)
 Saves all attachment files in a specific mail directory .../mail/<calculated_path>/mail_<mail_id>_<user_id>/... More...
 
 saveFile (int $a_mail_id, string $a_attachment)
 Save attachment file in a specific mail directory .../mail/<calculated_path>/mail_<mail_id>_<user_id>/... More...
 
 checkFilesExist (array $a_files)
 
 assignAttachmentsToDirectory (int $a_mail_id, int $a_sent_mail_id)
 
 deassignAttachmentFromDirectory (int $a_mail_id)
 
 deliverAttachmentsAsZip (string $basename, int $mail_id, array $files=[], bool $is_draft=false)
 
- Public Member Functions inherited from ilFileData
 __construct ()
 
 checkPath (string $a_path)
 
 getPath ()
 
- Public Member Functions inherited from ilFile
 deleteTrailingSlash (string $a_path)
 delete trailing slash of path variables More...
 

Static Public Member Functions

static getStorage (int $a_mail_id, int $a_usr_id)
 

Data Fields

string $mail_path
 

Protected Member Functions

 initAttachmentMaxUploadSize ()
 

Protected Attributes

int $mail_max_upload_file_size
 
Filesystem $tmp_directory
 
Filesystem $storage_directory
 
ilDBInterface $db
 
ILIAS $ilias
 
- Protected Attributes inherited from ilFile
string $path
 

Private Member Functions

 getAttachmentPathByMailId (int $mail_id)
 
 rotateFiles (string $a_path)
 
 deleteAttachmentDirectory (string $a_rel_path)
 

Detailed Description

Definition at line 24 of file class.ilFileDataMail.php.

Constructor & Destructor Documentation

◆ __construct()

ilFileDataMail::__construct ( public int  $user_id = 0)

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

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), checkReadWrite(), ilFileData\getPath(), initAttachmentMaxUploadSize(), and MAILPATH.

34  {
35  global $DIC;
36 
37  if (!defined('MAILPATH')) {
38  define('MAILPATH', 'mail');
39  }
41  $this->mail_path = $this->getPath() . '/' . MAILPATH;
42  $this->ilias = $DIC['ilias'];
43  $this->db = $DIC->database();
44  $this->tmp_directory = $DIC->filesystem()->temp();
45  $this->storage_directory = $DIC->filesystem()->storage();
46 
47  $this->checkReadWrite();
49  }
const MAILPATH
Definition: constants.php:50
global $DIC
Definition: shib_login.php:26
Class ilObjForumAdministration.
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ adoptAttachments()

ilFileDataMail::adoptAttachments ( array  $a_attachments,
int  $a_mail_id 
)
Parameters
list<string>$a_attachments

Definition at line 150 of file class.ilFileDataMail.php.

References ilFile\$path, getAttachmentPath(), and getMailPath().

150  : string
151  {
152  foreach ($a_attachments as $file) {
153  $path = $this->getAttachmentPath($file, $a_mail_id);
154  if (!copy($path, $this->getMailPath() . '/' . $this->user_id . '_' . $file)) {
155  return 'ERROR: ' . $this->getMailPath() . '/' . $this->user_id . '_' . $file . ' cannot be created';
156  }
157  }
158 
159  return '';
160  }
getAttachmentPath(string $a_filename, int $a_mail_id)
string $path
+ Here is the call graph for this function:

◆ assignAttachmentsToDirectory()

ilFileDataMail::assignAttachmentsToDirectory ( int  $a_mail_id,
int  $a_sent_mail_id 
)

Definition at line 378 of file class.ilFileDataMail.php.

378  : void
379  {
380  $storage = self::getStorage($a_sent_mail_id, $this->user_id);
381  $this->db->manipulateF(
382  '
383  INSERT INTO mail_attachment
384  ( mail_id, path) VALUES (%s, %s)',
385  ['integer', 'text'],
386  [$a_mail_id, $storage->getRelativePathExMailDirectory()]
387  );
388  }

◆ checkFilesExist()

ilFileDataMail::checkFilesExist ( array  $a_files)
Parameters
list<string>$a_files

Definition at line 365 of file class.ilFileDataMail.php.

365  : bool
366  {
367  if ($a_files !== []) {
368  foreach ($a_files as $file) {
369  if (!is_file($this->mail_path . '/' . $this->user_id . '_' . $file)) {
370  return false;
371  }
372  }
373  }
374 
375  return true;
376  }

◆ checkReadWrite()

ilFileDataMail::checkReadWrite ( )

Definition at line 162 of file class.ilFileDataMail.php.

Referenced by __construct().

162  : bool
163  {
164  if (is_writable($this->mail_path) && is_readable($this->mail_path)) {
165  return true;
166  }
167 
168  $this->ilias->raiseError(
169  'Mail directory is not readable/writable by webserver: ' .
170  $this->mail_path,
171  $this->ilias->error_obj->FATAL
172  );
173 
174  return false;
175  }
Class ilObjForumAdministration.
+ Here is the caller graph for this function:

◆ copyAttachmentFile()

ilFileDataMail::copyAttachmentFile ( string  $a_abs_path,
string  $a_new_name 
)

Definition at line 270 of file class.ilFileDataMail.php.

References getMailPath().

270  : bool
271  {
272  @copy($a_abs_path, $this->getMailPath() . '/' . $this->user_id . '_' . $a_new_name);
273 
274  return true;
275  }
+ Here is the call graph for this function:

◆ deassignAttachmentFromDirectory()

ilFileDataMail::deassignAttachmentFromDirectory ( int  $a_mail_id)

Definition at line 390 of file class.ilFileDataMail.php.

References ilFile\$path, $res, deleteAttachmentDirectory(), and ILIAS\Repository\int().

390  : bool
391  {
392  $res = $this->db->query(
393  'SELECT path FROM mail_attachment WHERE mail_id = ' . $this->db->quote($a_mail_id, 'integer')
394  );
395 
396  $path = '';
397  while ($row = $this->db->fetchObject($res)) {
398  $path = (string) $row->path;
399  }
400 
401  if ($path !== '') {
402  $res = $this->db->query(
403  'SELECT COUNT(mail_id) count_mail_id FROM mail_attachment WHERE path = ' .
404  $this->db->quote($path, 'text')
405  ) ;
406 
407  $cnt_mail_id = 0;
408  while ($row = $this->db->fetchObject($res)) {
409  $cnt_mail_id = (int) $row->count_mail_id;
410  }
411 
412  if ($cnt_mail_id === 1) {
414  }
415  }
416 
417  $this->db->manipulateF(
418  'DELETE FROM mail_attachment WHERE mail_id = %s',
419  ['integer'],
420  [$a_mail_id]
421  );
422 
423  return true;
424  }
$res
Definition: ltiservices.php:66
string $path
deleteAttachmentDirectory(string $a_rel_path)
+ Here is the call graph for this function:

◆ deleteAttachmentDirectory()

ilFileDataMail::deleteAttachmentDirectory ( string  $a_rel_path)
private

Definition at line 426 of file class.ilFileDataMail.php.

References ilFileUtils\delDir().

Referenced by deassignAttachmentFromDirectory().

426  : void
427  {
428  ilFileUtils::delDir($this->mail_path . '/' . $a_rel_path);
429  }
static delDir(string $a_dir, bool $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deliverAttachmentsAsZip()

ilFileDataMail::deliverAttachmentsAsZip ( string  $basename,
int  $mail_id,
array  $files = [],
bool  $is_draft = false 
)
Parameters
list<string>$files

Definition at line 544 of file class.ilFileDataMail.php.

References $filename, ilFile\$path, ilFileDelivery\deliverFileAttached(), getAbsoluteAttachmentPoolPathByFilename(), ilFileUtils\getASCIIFilename(), getAttachmentPathByMailId(), ilFileUtils\getValidFilename(), ilFileUtils\ilTempnam(), MAILPATH, and ilFileUtils\zip().

549  : void {
550  $path = '';
551  if (!$is_draft) {
552  $path = $this->getAttachmentPathByMailId($mail_id);
553  if ($path === '') {
554  throw new ilMailException('mail_download_zip_no_attachments');
555  }
556  }
557 
558  $download_filename = ilFileUtils::getASCIIFilename($basename);
559  if ($download_filename === '') {
560  $download_filename = 'attachments';
561  }
562 
563  $processing_directory = ilFileUtils::ilTempnam();
564  $relative_processing_directory = basename($processing_directory);
565 
566  $absolute_zip_directory = $processing_directory . '/' . $download_filename;
567  $relative_zip_directory = $relative_processing_directory . '/' . $download_filename;
568 
569  $this->tmp_directory->createDir($relative_zip_directory);
570 
571  foreach ($files as $filename) {
572  if ($is_draft) {
573  $source = str_replace(
574  $this->mail_path,
575  MAILPATH,
577  );
578  } else {
579  $source = MAILPATH . '/' . $path . '/' . $filename;
580  }
581 
582  $source = str_replace('//', '/', $source);
583  if (!$this->storage_directory->has($source)) {
584  continue;
585  }
586 
587  $target = $relative_zip_directory . '/' . $filename;
588 
589  $stream = $this->storage_directory->readStream($source);
590  $this->tmp_directory->writeStream($target, $stream);
591  }
592 
593  $path_to_zip_file = $processing_directory . '/' . $download_filename . '.zip';
594  ilFileUtils::zip($absolute_zip_directory, $path_to_zip_file);
595 
596  $this->tmp_directory->deleteDir($relative_zip_directory);
597 
599  $processing_directory . '/' . $download_filename . '.zip',
600  ilFileUtils::getValidFilename($download_filename . '.zip')
601  );
602  }
getAbsoluteAttachmentPoolPathByFilename(string $filename)
Resolves a path for a passed filename in regards of a user&#39;s mail attachment pool, meaning attachments not being sent.
static getValidFilename(string $a_filename)
const MAILPATH
Definition: constants.php:50
static getASCIIFilename(string $a_filename)
static deliverFileAttached(string $path_to_file, ?string $download_file_name=null, ?string $mime_type=null, bool $delete_file=false)
getAttachmentPathByMailId(int $mail_id)
$filename
Definition: buildRTE.php:78
static ilTempnam(?string $a_temp_path=null)
Returns a unique and non existing Path for e temporary file or directory.
static zip(string $a_dir, string $a_file, bool $compress_content=false)
string $path
+ Here is the call graph for this function:

◆ getAbsoluteAttachmentPoolPathByFilename()

ilFileDataMail::getAbsoluteAttachmentPoolPathByFilename ( string  $filename)

Resolves a path for a passed filename in regards of a user's mail attachment pool, meaning attachments not being sent.

Definition at line 314 of file class.ilFileDataMail.php.

References $filename, and getAbsoluteAttachmentPoolPathPrefix().

Referenced by deliverAttachmentsAsZip().

314  : string
315  {
317  }
$filename
Definition: buildRTE.php:78
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAbsoluteAttachmentPoolPathPrefix()

ilFileDataMail::getAbsoluteAttachmentPoolPathPrefix ( )

Definition at line 83 of file class.ilFileDataMail.php.

Referenced by getAbsoluteAttachmentPoolPathByFilename().

83  : string
84  {
85  return $this->mail_path . '/' . $this->user_id . '_';
86  }
+ Here is the caller graph for this function:

◆ getAttachmentPath()

ilFileDataMail::getAttachmentPath ( string  $a_filename,
int  $a_mail_id 
)

Definition at line 136 of file class.ilFileDataMail.php.

References ilFile\$path, getAttachmentPathByMailId(), and getMailPath().

Referenced by adoptAttachments().

136  : string
137  {
138  $path = $this->getMailPath() . '/' . $this->getAttachmentPathByMailId($a_mail_id) . '/' . $a_filename;
139 
140  if (is_readable($path)) {
141  return $path;
142  }
143 
144  return '';
145  }
getAttachmentPathByMailId(int $mail_id)
string $path
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAttachmentPathAndFilenameByMd5Hash()

ilFileDataMail::getAttachmentPathAndFilenameByMd5Hash ( string  $md5FileHash,
int  $mail_id 
)
Returns
array{path: string, filename: string} An array containing 'path' and 'filename' for the passed MD5 hash
Exceptions
OutOfBoundsException

Definition at line 92 of file class.ilFileDataMail.php.

References ilFile\$path, $res, ilFileUtils\getDir(), and getMailPath().

Referenced by ilMailFolderGUI\deliverFile().

92  : array
93  {
94  $res = $this->db->queryF(
95  'SELECT path FROM mail_attachment WHERE mail_id = %s',
96  ['integer'],
97  [$mail_id]
98  );
99 
100  if ($this->db->numRows($res) !== 1) {
101  throw new OutOfBoundsException();
102  }
103 
104  $row = $this->db->fetchAssoc($res);
105 
106  $relative_path = $row['path'];
107  $path = $this->getMailPath() . '/' . $row['path'];
108 
109  $files = ilFileUtils::getDir($path);
110  foreach ($files as $file) {
111  if ($file['type'] === 'file' && md5($file['entry']) === $md5FileHash) {
112  return [
113  'path' => $this->getMailPath() . '/' . $relative_path . '/' . $file['entry'],
114  'filename' => $file['entry'],
115  ];
116  }
117  }
118 
119  throw new OutOfBoundsException();
120  }
$res
Definition: ltiservices.php:66
static getDir(string $a_dir, bool $a_rec=false, ?string $a_sub_dir="")
get directory
string $path
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAttachmentPathByMailId()

ilFileDataMail::getAttachmentPathByMailId ( int  $mail_id)
private

Definition at line 123 of file class.ilFileDataMail.php.

Referenced by deliverAttachmentsAsZip(), and getAttachmentPath().

123  : string
124  {
125  $query = $this->db->query(
126  'SELECT path FROM mail_attachment WHERE mail_id = ' . $this->db->quote($mail_id, 'integer')
127  );
128 
129  while ($row = $this->db->fetchObject($query)) {
130  return $row->path;
131  }
132 
133  return '';
134  }
+ Here is the caller graph for this function:

◆ getAttachmentsTotalSizeLimit()

ilFileDataMail::getAttachmentsTotalSizeLimit ( )

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

References null.

68  : ?float
69  {
70  $max_size = $this->ilias->getSetting('mail_maxsize_attach', '');
71  if ($max_size === '') {
72  return null;
73  }
74 
75  return (float) $this->ilias->getSetting('mail_maxsize_attach', '0') * 1024;
76  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
Class ilObjForumAdministration.

◆ getMailPath()

ilFileDataMail::getMailPath ( )

Definition at line 78 of file class.ilFileDataMail.php.

References $mail_path.

Referenced by adoptAttachments(), copyAttachmentFile(), getAttachmentPath(), getAttachmentPathAndFilenameByMd5Hash(), initAttachmentMaxUploadSize(), storeAsAttachment(), and storeUploadedFile().

78  : string
79  {
80  return $this->mail_path;
81  }
+ Here is the caller graph for this function:

◆ getStorage()

static ilFileDataMail::getStorage ( int  $a_mail_id,
int  $a_usr_id 
)
static

Definition at line 334 of file class.ilFileDataMail.php.

335  {
336  static $fsstorage_cache = [];
337 
338  $fsstorage_cache[$a_mail_id][$a_usr_id] = new ilFSStorageMail($a_mail_id, $a_usr_id);
339 
340  return $fsstorage_cache[$a_mail_id][$a_usr_id];
341  }

◆ getUploadLimit()

ilFileDataMail::getUploadLimit ( )

Definition at line 63 of file class.ilFileDataMail.php.

References $mail_max_upload_file_size.

Referenced by storeAsAttachment().

63  : int
64  {
66  }
+ Here is the caller graph for this function:

◆ getUserFilesData()

ilFileDataMail::getUserFilesData ( )
Returns
list<array{name: string, size: int, ctime: int}>

Definition at line 180 of file class.ilFileDataMail.php.

References $user_id.

180  : array
181  {
182  return $this->getUnsentFiles();
183  }

◆ initAttachmentMaxUploadSize()

ilFileDataMail::initAttachmentMaxUploadSize ( )
protected
Todo:
mjansen: Unfortunately we cannot reuse the implementation of ilFileInputGUI

Definition at line 431 of file class.ilFileDataMail.php.

References ilFile\$path, $res, getMailPath(), and ILIAS\Repository\int().

Referenced by __construct().

431  : void
432  {
435  // Copy of ilFileInputGUI: begin
436  // get the value for the maximal uploadable filesize from the php.ini (if available)
437  $umf = ini_get('upload_max_filesize');
438  // get the value for the maximal post data from the php.ini (if available)
439  $pms = ini_get('post_max_size');
440 
441  //convert from short-string representation to "real" bytes
442  $multiplier_a = ['K' => 1024, 'M' => 1024 * 1024, 'G' => 1024 * 1024 * 1024];
443 
444  $umf_parts = preg_split(
445  "/(\d+)([K|G|M])/",
446  (string) $umf,
447  -1,
448  PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY
449  );
450  $pms_parts = preg_split(
451  "/(\d+)([K|G|M])/",
452  (string) $pms,
453  -1,
454  PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY
455  );
456 
457  if ((is_countable($umf_parts) ? count($umf_parts) : 0) === 2) {
458  $umf = (float) $umf_parts[0] * $multiplier_a[$umf_parts[1]];
459  }
460  if ((is_countable($pms_parts) ? count($pms_parts) : 0) === 2) {
461  $pms = (float) $pms_parts[0] * $multiplier_a[$pms_parts[1]];
462  }
463 
464  // use the smaller one as limit
465  $max_filesize = min($umf, $pms);
466 
467  if (!$max_filesize) {
468  $max_filesize = max($umf, $pms);
469  }
470 
471  $this->mail_max_upload_file_size = (int) $max_filesize;
472  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initDirectory()

ilFileDataMail::initDirectory ( )

Definition at line 51 of file class.ilFileDataMail.php.

References ilFileData\getPath(), and MAILPATH.

51  : bool
52  {
53  if (is_writable($this->getPath())
54  && mkdir($this->getPath() . '/' . MAILPATH)
55  && chmod($this->getPath() . '/' . MAILPATH, 0755)) {
56  $this->mail_path = $this->getPath() . '/' . MAILPATH;
57  return true;
58  }
59 
60  return false;
61  }
const MAILPATH
Definition: constants.php:50
+ Here is the call graph for this function:

◆ rotateFiles()

ilFileDataMail::rotateFiles ( string  $a_path)
private

Definition at line 277 of file class.ilFileDataMail.php.

References ilFileUtils\rename().

Referenced by storeAsAttachment(), and storeUploadedFile().

277  : bool
278  {
279  if (is_file($a_path)) {
280  $this->rotateFiles($a_path . '.old');
281  return ilFileUtils::rename($a_path, $a_path . '.old');
282  }
283 
284  return true;
285  }
rotateFiles(string $a_path)
static rename(string $a_source, string $a_target)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveFile()

ilFileDataMail::saveFile ( int  $a_mail_id,
string  $a_attachment 
)

Save attachment file in a specific mail directory .../mail/<calculated_path>/mail_<mail_id>_<user_id>/...

Definition at line 346 of file class.ilFileDataMail.php.

Referenced by saveFiles().

346  : bool
347  {
348  $storage = self::getStorage($a_mail_id, $this->user_id);
349  $storage->create();
350  $storage_directory = $storage->getAbsolutePath();
351 
352  if (!is_dir($storage_directory)) {
353  return false;
354  }
355 
356  return copy(
357  $this->mail_path . '/' . $this->user_id . '_' . $a_attachment,
358  $storage_directory . '/' . $a_attachment
359  );
360  }
Filesystem $storage_directory
+ Here is the caller graph for this function:

◆ saveFiles()

ilFileDataMail::saveFiles ( int  $a_mail_id,
array  $a_attachments 
)

Saves all attachment files in a specific mail directory .../mail/<calculated_path>/mail_<mail_id>_<user_id>/...

Parameters
list<string>$a_attachments

Definition at line 323 of file class.ilFileDataMail.php.

References saveFile().

323  : void
324  {
325  if (!is_numeric($a_mail_id) || $a_mail_id < 1) {
326  throw new InvalidArgumentException('The passed mail_id must be a valid integer!');
327  }
328 
329  foreach ($a_attachments as $attachment) {
330  $this->saveFile($a_mail_id, $attachment);
331  }
332  }
saveFile(int $a_mail_id, string $a_attachment)
Save attachment file in a specific mail directory .../mail/<calculated_path>/mail_<mail_id>_<user_id>...
+ Here is the call graph for this function:

◆ storeAsAttachment()

ilFileDataMail::storeAsAttachment ( string  $a_filename,
string  $a_content 
)

Definition at line 212 of file class.ilFileDataMail.php.

References ilFileUtils\_sanitizeFilemame(), getMailPath(), getUploadLimit(), and rotateFiles().

212  : string
213  {
214  if (strlen($a_content) >= $this->getUploadLimit()) {
215  throw new DomainException(
216  sprintf(
217  'Mail upload limit reached for user with id %s',
218  $this->user_id
219  )
220  );
221  }
222 
223  $name = ilFileUtils::_sanitizeFilemame($a_filename);
224  $this->rotateFiles($this->getMailPath() . '/' . $this->user_id . '_' . $name);
225 
226  $abs_path = $this->getMailPath() . '/' . $this->user_id . '_' . $name;
227 
228  $fp = fopen($abs_path, 'wb+');
229  if (!is_resource($fp)) {
230  throw new RuntimeException(
231  sprintf(
232  'Could not read file: %s',
233  $abs_path
234  )
235  );
236  }
237 
238  if (fwrite($fp, $a_content) === false) {
239  fclose($fp);
240  throw new RuntimeException(
241  sprintf(
242  'Could not write file: %s',
243  $abs_path
244  )
245  );
246  }
247 
248  fclose($fp);
249 
250  return $name;
251  }
rotateFiles(string $a_path)
static _sanitizeFilemame(string $a_filename)
+ Here is the call graph for this function:

◆ storeUploadedFile()

ilFileDataMail::storeUploadedFile ( UploadResult  $result)

Definition at line 253 of file class.ilFileDataMail.php.

References $filename, ilFileUtils\_sanitizeFilemame(), getMailPath(), ILIAS\FileUpload\DTO\UploadResult\getName(), ILIAS\FileUpload\DTO\UploadResult\getPath(), ilFileUtils\moveUploadedFile(), and rotateFiles().

253  : string
254  {
256  $result->getName()
257  );
258 
259  $this->rotateFiles($this->getMailPath() . '/' . $this->user_id . '_' . $filename);
260 
262  $result->getPath(),
263  $filename,
264  $this->getMailPath() . '/' . $this->user_id . '_' . $filename
265  );
266 
267  return $filename;
268  }
rotateFiles(string $a_path)
static moveUploadedFile(string $a_file, string $a_name, string $a_target, bool $a_raise_errors=true, string $a_mode="move_uploaded")
move uploaded file
static _sanitizeFilemame(string $a_filename)
$filename
Definition: buildRTE.php:78
+ Here is the call graph for this function:

◆ unlinkFile()

ilFileDataMail::unlinkFile ( string  $a_filename)

Definition at line 301 of file class.ilFileDataMail.php.

Referenced by unlinkFiles().

301  : bool
302  {
303  if (is_file($this->mail_path . '/' . basename($this->user_id . '_' . $a_filename))) {
304  return unlink($this->mail_path . '/' . basename($this->user_id . '_' . $a_filename));
305  }
306 
307  return false;
308  }
+ Here is the caller graph for this function:

◆ unlinkFiles()

ilFileDataMail::unlinkFiles ( array  $a_filenames)
Parameters
list<string>$a_filenames

Definition at line 290 of file class.ilFileDataMail.php.

References unlinkFile().

290  : string
291  {
292  foreach ($a_filenames as $file) {
293  if (!$this->unlinkFile($file)) {
294  return $file;
295  }
296  }
297 
298  return '';
299  }
unlinkFile(string $a_filename)
+ Here is the call graph for this function:

Field Documentation

◆ $db

ilDBInterface ilFileDataMail::$db
protected

Definition at line 30 of file class.ilFileDataMail.php.

◆ $ilias

ILIAS ilFileDataMail::$ilias
protected

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

◆ $mail_max_upload_file_size

int ilFileDataMail::$mail_max_upload_file_size
protected

Definition at line 27 of file class.ilFileDataMail.php.

Referenced by getUploadLimit().

◆ $mail_path

string ilFileDataMail::$mail_path

Definition at line 26 of file class.ilFileDataMail.php.

Referenced by getMailPath().

◆ $storage_directory

Filesystem ilFileDataMail::$storage_directory
protected

Definition at line 29 of file class.ilFileDataMail.php.

◆ $tmp_directory

Filesystem ilFileDataMail::$tmp_directory
protected

Definition at line 28 of file class.ilFileDataMail.php.


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