1 | <?php |
||
17 | * Class sfUploader |
||
18 | */ |
||
19 | class sfUploader extends XoopsMediaUploader |
||
20 | { |
||
21 | /** |
||
22 | * No admin check for uploads |
||
23 | */ |
||
24 | /** |
||
25 | * Constructor |
||
26 | * |
||
27 | * @param string $uploadDir |
||
28 | * @param array|int $allowedMimeTypes |
||
29 | * @param int $maxFileSize |
||
30 | * @param int $maxWidth |
||
31 | * @param int $maxHeight |
||
32 | */ |
||
33 | public function __construct($uploadDir, $allowedMimeTypes = 0, $maxFileSize = 0, $maxWidth = 0, $maxHeight = 0) |
||
53 | |||
54 | /** |
||
55 | * Set the CheckMediaTypeByExt |
||
56 | * Deprecated |
||
57 | * |
||
58 | * @param bool|string $value |
||
59 | */ |
||
60 | public function setCheckMediaTypeByExt($value = true) |
||
63 | |||
64 | /** |
||
65 | * Set the imageSizeCheck |
||
66 | * Deprecated |
||
67 | * |
||
68 | * @param string $value |
||
69 | */ |
||
70 | public function setImageSizeCheck($value) |
||
73 | |||
74 | /** |
||
75 | * Set the fileSizeCheck |
||
76 | * Deprecated |
||
77 | * |
||
78 | * @param string $value |
||
79 | */ |
||
80 | public function setFileSizeCheck($value) |
||
83 | |||
84 | /** |
||
85 | * Get the file extension |
||
86 | * |
||
87 | * @return string |
||
88 | */ |
||
89 | public function getExt() |
||
90 | { |
||
91 | $this->ext = strtolower(ltrim(strrchr($this->getMediaName(), '.'), '.')); |
||
92 | |||
93 | return $this->ext; |
||
94 | } |
||
96 |
The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.
The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.
To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.