mirror of
https://gh.wpcy.net/https://github.com/wp-cli/handbook.git
synced 2026-04-26 08:31:16 +08:00
- Organize files in folders according to the desired structure - Use directory iterator to loop through all files and folders (makes generation more robust)
1.7 KiB
1.7 KiB
WP_CLI\Utils\normalize_path()
Normalize a filesystem path.
Usage
WP_CLI\Utils\normalize_path( $path )
$path (string) Path to normalize.
@return (string) path.
@return (string) path.
Notes
On Windows systems, replaces backslashes with forward slashes and forces upper-case drive letters. Allows for two leading slashes for Windows network shares, but ensures that all other duplicate slashes are reduced to a single one. Ensures upper-case drive letters on Windows systems.
Internal API documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.
Related
- WP_CLI\Utils\get_home_dir() - Get the home directory.
- WP_CLI\Utils\trailingslashit() - Appends a trailing slash.
- WP_CLI\Utils\get_temp_dir() - Get the system's temp directory. Warns user if it isn't writable.
- WP_CLI\Utils\get_php_binary() - Get the path to the PHP binary used when executing WP-CLI.
- WP_CLI::get_php_binary() - Get the path to the PHP binary used when executing WP-CLI.