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