ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
UploadLimitResolver.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
21 
26 {
28 
29  public function __construct(int $default_upload_size_limit)
30  {
31  $this->default_upload_size_limit = $default_upload_size_limit;
32  }
33 
34  public function min(int $size_in_bytes): int
35  {
36  return min($this->default_upload_size_limit, $size_in_bytes);
37  }
38 
39  public function max(int $size_in_bytes): int
40  {
41  return max($this->default_upload_size_limit, $size_in_bytes);
42  }
43 
44  public function checkUploadLimit(int $size_in_bytes): void
45  {
46  if ($size_in_bytes > $this->default_upload_size_limit) {
47  throw new \InvalidArgumentException("File size exceeds $this->default_upload_size_limit bytest.");
48  }
49  }
50 
51  public function getUploadLimit(): int
52  {
54  }
55 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...