title: "WP_CLI\Utils\parse_ssh_url()" post_status: publish comment_status: open taxonomy: category: - wp-cli-handbook post_tag: - Internal Api - References - Repos
WP_CLI\Utils\parse_ssh_url()
解析 SSH URL 获取主机、端口和路径信息。
使用方法
WP_CLI\Utils\parse_ssh_url( $url, $component = -1 )
$url (string)
$component (int)
@return (mixed)
$component (int)
@return (mixed)
说明
功能类似 parse_url(),但增加了对已定义 SSH 别名的支持。
主机名 或 主机名/wordpress路径 或 主机名:端口/wordpress路径
内部 API 文档随每个版本从 WP-CLI 代码库自动生成。如需改进建议,请提交拉取请求。
相关函数
- WP_CLI\Utils\write_csv() - 将数据以 CSV 格式写入指定文件
- WP_CLI\Utils\http_request() - 向远程 URL 发起 HTTP 请求
- WP_CLI\Utils\get_named_sem_ver() - 比较两个版本字符串获取语义化版本名称
- WP_CLI\Utils\basename() - 与区域设置无关的 basename() 版本
- WP_CLI\Utils\isPiped() - 检测当前脚本输出是 TTY 还是管道/重定向
- WP_CLI\Utils\proc_open_compat() - Windows 兼容的 `proc_open()`。修复 PHP 中的错误,并处理类 Unix 的 `ENV_VAR=blah cmd` 环境变量前缀
- WP_CLI\Utils\esc_like() - 为 MySQL 准备数据前,对 LIKE 特殊字符 % 和 _ 进行转义的前半部分操作