1 | <?php |
||
18 | class Utils |
||
19 | { |
||
20 | public static function recurseDelete(string $src) |
||
48 | |||
49 | /** |
||
50 | * Get absolute URL for Portal2. |
||
51 | * |
||
52 | * @param string $url |
||
53 | * |
||
54 | * @return string |
||
55 | */ |
||
56 | public static function absoluteUrl(string $url): string |
||
60 | |||
61 | /** |
||
62 | * Get public url from file. |
||
63 | * |
||
64 | * @param string $name |
||
65 | * @param bool $full |
||
66 | * |
||
67 | * @return string |
||
68 | */ |
||
69 | public static function getPublicUrl($name, $full = false): string |
||
80 | |||
81 | /** |
||
82 | * Replacement for the ucfirst function for proper Multibyte String operation. |
||
83 | * Delete function will exist as mb_ucfirst. |
||
84 | * |
||
85 | * @param string $string |
||
86 | * |
||
87 | * @return string |
||
88 | */ |
||
89 | public static function mbUcfirst(string $string): string |
||
93 | |||
94 | /** |
||
95 | * Parse bytes. |
||
96 | * |
||
97 | * @param mixed $str |
||
98 | * |
||
99 | * @return float |
||
100 | */ |
||
101 | public static function parseBytes($str): float |
||
128 | |||
129 | /** |
||
130 | * Show bytes. |
||
131 | * |
||
132 | * @param mixed $bytes |
||
133 | * @param string|null $unit |
||
134 | * |
||
135 | * @return string |
||
136 | */ |
||
137 | public static function showBytes($bytes, &$unit = null): string |
||
157 | } |
||
158 |
If you suppress an error, we recommend checking for the error condition explicitly: