Verzeichnisstruktur phpBB-3.3.15
- Veröffentlicht
- 28.08.2024
So funktioniert es
|
Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück |
Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis. |
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
base.php
01 <?php
02 /**
03 *
04 * This file is part of the phpBB Forum Software package.
05 *
06 * @copyright (c) phpBB Limited <https://www.phpbb.com>
07 * @license GNU General Public License, version 2 (GPL-2.0)
08 *
09 * For full copyright and license information, please see
10 * the docs/CREDITS.txt file.
11 *
12 */
13
14 namespace phpbb\files\types;
15
16 abstract class base implements type_interface
17 {
18 /** @var \phpbb\language\language */
19 protected $language;
20
21 /** @var \bantu\IniGetWrapper\IniGetWrapper */
22 protected $php_ini;
23
24 /** @var \phpbb\files\upload */
25 protected $upload;
26
27 /**
28 * Check if upload exceeds maximum file size
29 *
30 * @param \phpbb\files\filespec $file Filespec object
31 *
32 * @return \phpbb\files\filespec Returns same filespec instance
33 */
34 public function check_upload_size($file)
35 {
36 // PHP Upload filesize exceeded
37 if ($file->get('filename') == 'none')
38 {
39 $max_filesize = $this->php_ini->getString('upload_max_filesize');
40 $unit = 'MB';
41
42 if (!empty($max_filesize))
43 {
44 $unit = strtolower(substr($max_filesize, -1, 1));
45 $max_filesize = (int) $max_filesize;
46
47 $unit = ($unit == 'k') ? 'KB' : (($unit == 'g') ? 'GB' : 'MB');
48 }
49
50 $file->error[] = (empty($max_filesize)) ? $this->language->lang($this->upload->error_prefix . 'PHP_SIZE_NA') : $this->language->lang($this->upload->error_prefix . 'PHP_SIZE_OVERRUN', $max_filesize, $this->language->lang($unit));
51 }
52
53 return $file;
54 }
55
56 /**
57 * {@inheritdoc}
58 */
59 public function set_upload(\phpbb\files\upload $upload)
60 {
61 $this->upload = $upload;
62
63 return $this;
64 }
65 }
66