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