| @@ 193-209 (lines=17) @@ | ||
| 190 | } |
|
| 191 | } |
|
| 192 | ||
| 193 | if(!function_exists('removeLastPath')) { |
|
| 194 | /** |
|
| 195 | * @param string $string |
|
| 196 | * @return bool|string |
|
| 197 | */ |
|
| 198 | function removeLastPath($string) |
|
| 199 | { |
|
| 200 | $pos = strrpos($string, '/'); |
|
| 201 | if ($pos !== false) { |
|
| 202 | $path = substr($string, 0, $pos); |
|
| 203 | } else { |
|
| 204 | $path = false; |
|
| 205 | } |
|
| 206 | ||
| 207 | return $path; |
|
| 208 | } |
|
| 209 | } |
|
| 210 | ||
| 211 | if(!function_exists('getExtension')) { |
|
| 212 | /** |
|
| @@ 211-230 (lines=20) @@ | ||
| 208 | } |
|
| 209 | } |
|
| 210 | ||
| 211 | if(!function_exists('getExtension')) { |
|
| 212 | /** |
|
| 213 | * @param string $string |
|
| 214 | * @return bool|string |
|
| 215 | * |
|
| 216 | * @TODO: not work if $string contains folder name with dot |
|
| 217 | */ |
|
| 218 | function getExtension($string) |
|
| 219 | { |
|
| 220 | $pos = strrpos($string, '.'); |
|
| 221 | if ($pos !== false) { |
|
| 222 | $ext = substr($string, $pos); |
|
| 223 | $ext = strtolower($ext); |
|
| 224 | } else { |
|
| 225 | $ext = false; |
|
| 226 | } |
|
| 227 | ||
| 228 | return $ext; |
|
| 229 | } |
|
| 230 | } |
|
| 231 | ||
| 232 | if(!function_exists('checkExtension')) { |
|
| 233 | /** |
|