amzil-ayoub/wp-cli
Composer 安装命令:
composer require amzil-ayoub/wp-cli
包简介
A command-line tool to download and install any version of WordPress with custom folder naming. Perfect for developers who need to quickly set up WordPress instances.
README 文档
README
A command-line tool to download and install any version of WordPress with custom folder naming. Perfect for developers who need to quickly set up WordPress instances.
Features
- Custom Folder Names: Specify a custom folder name or use the default version-based name.
- Version-Specific Downloads:
- Download specific WordPress versions (
v=major,v=major.minor, orv=major.minor.path). - Automatically constructs the correct download URL based on the version format.
- Download specific WordPress versions (
- Cross-Platform: Works on both Windows and Unix-based systems.
- Error Handling: Validates folder names, version formats, and checks if the specified version exists.
Installation
Install via Composer
composer global require ayoub-amzil/wp-cli
Usage
Basic Usage
wp
This will:
-
Fetch the latest WordPress version.
-
Download and extract it into a folder named wordpress_{version}_{timestamp}.
Custom Folder Name
Specify a custom folder name:
wp my-project
This will:
-
Fetch the latest WordPress version.
-
Download and extract it into a folder named my-project.
Specific WordPress Version
Download a specific version of WordPress:
Major Version Only
wp v=6
Downloads: https://wordpress.org/wordpress-6.0.zip
Major and Minor Version
wp v=6.2
Downloads: https://wordpress.org/wordpress-6.2.zip
Full Version with Patch
wp v=6.2.1
Downloads: https://wordpress.org/wordpress-6.2.1.zip
Custom Folder Name + Specific Version
Combine a custom folder name with a specific version:
wp my-project v=6.2.1
This will:
-
Download WordPress 6.2.1.
-
Extract it into a folder named my-project.
Examples
Example 1: Default Behavior
wp
Output:
================================
WordPress Installation Tool
================================
Fetching latest WordPress version...
⬇Downloading WordPress 6.7.2...
Extracting files to: wordpress_6.7.2_20250317020433
Success! WordPress 6.7.2 installed at:
/path/to/wordpress_6.7.2_20250317020433
Example 2: Custom Folder + Specific Version
wp my-site v=6.2
Output:
================================
WordPress Installation Tool
================================
⬇Downloading WordPress 6.2...
Extracting files to: my-site
Sccess! WordPress 6.2 installed at:
/path/to/my-site
Example 3: Invalid Version
wp v=6.2.99
Output:
================================ WordPress Installation Tool ================================ Error: WordPress version 6.2.99 does not exist.
Error Handling
The tool provides clear error messages for common issues:
-
Invalid folder name: Only alphanumeric, hyphens, and underscores are allowed.
-
Invalid version format: Must be major, major.minor, or major.minor.path.
-
Version does not exist: Checks if the specified WordPress version is available for download.
-
Directory already exists: Prevents overwriting existing directories.
Development
Requirements
-
PHP 8.0+
-
Composer
-
ext-zip PHP extension
amzil-ayoub/wp-cli 适用场景与选型建议
amzil-ayoub/wp-cli 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 57 次下载、GitHub Stars 达 1, 最近一次更新时间为 2025 年 03 月 17 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 amzil-ayoub/wp-cli 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 amzil-ayoub/wp-cli 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 57
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 18
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2025-03-17