| 1 | <?php |
||
| 5 | class PathHelper |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * Return whether two paths are equal, ignore their file extension. |
||
| 9 | * |
||
| 10 | * @param string $path1 |
||
| 11 | * @param string $path2 |
||
| 12 | * @return string |
||
| 13 | */ |
||
| 14 | 1 | public static function arePathsEqualIgnoringFileExtension($path1, $path2) |
|
| 19 | |||
| 20 | /** |
||
| 21 | * Remove the file extension from the given path. The query string, if there is one, will be |
||
| 22 | * preserved. |
||
| 23 | * |
||
| 24 | * @param string $path E.g. http://example/path/file.jpg?foo=bar |
||
| 25 | * @return string E.g. http://example/path/file?foo=bar |
||
| 26 | */ |
||
| 27 | 6 | public static function removeFileExtensionAndKeepQueryString($path) |
|
| 46 | } |
||
| 47 |