Normalise a directory path: ensure it uses forward slashes and ends with `/`.
(path: &str)
| 373 | |
| 374 | /// Normalise a directory path: ensure it uses forward slashes and ends with `/`. |
| 375 | pub fn normalise_path(path: &str) -> String { |
| 376 | let p = path.replace('\\', "/"); |
| 377 | if p.ends_with('/') || p.is_empty() { |
| 378 | p |
| 379 | } else { |
| 380 | format!("{}/", p) |
| 381 | } |
| 382 | } |
| 383 | |
| 384 | /// Resolve a fully-qualified PHP class name to a file path using PSR-4 mappings. |
| 385 | /// |