Skip to content

Commit 6c618a7

Browse files
author
Tinywan
committed
docs: update README.md with v0.0.16 image, --refresh-main option, and full dist layout
1 parent 7140adf commit 6c618a7

2 files changed

Lines changed: 23 additions & 8 deletions

File tree

‎README.md‎

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,12 @@ php webman typephp:package
5454

5555
# dist/ 已存在时,显式确认覆盖
5656
php webman typephp:package --force
57+
58+
# 强制使用最新 TypePHP stub 重置 main.php 入口(原有 main.php 会自动备份为 main.php.bak)
59+
php webman typephp:package --refresh-main
5760
```
5861

59-
默认 builder 为 `tinywan/typephp-webman-builder:v0.0.13`。编译在 Docker 中完成,宿主机不需要 C++、Clang 或 TypePHP 编译器。
62+
默认 builder 为 `tinywan/typephp-webman-builder:v0.0.16`。编译在 Docker 中完成,宿主机不需要 C++、Clang 或 TypePHP 编译器。
6063

6164
### 4. 启动产物
6265

@@ -67,7 +70,7 @@ cd dist
6770
./start.sh start
6871
```
6972

70-
`start.sh` 会自动把随包发布的 `lib/` 加入动态库搜索路径,并将参数传给 `webman-server.bin`。也支持 Webman 常用命令:
73+
`start.sh` 会自动指定 `PHPRC` 加载随包的 `php.ini`,并将随包发布的 `lib/` 加入动态库搜索路径。也支持 Webman 常用命令:
7174

7275
```bash
7376
./start.sh start -d
@@ -76,29 +79,41 @@ cd dist
7679
./start.sh restart
7780
```
7881

82+
也可以直接通过包装脚本启动:
83+
```bash
84+
./webman-server start
85+
```
86+
7987
## 📦 产物契约
8088

81-
成功构建后的核心目录如下:
89+
成功构建后的完整目录结构如下(与全静态便携环境 100% 对齐):
8290

8391
```text
8492
dist/
8593
├── webman-server.bin # TypePHP 生成的 ELF 原生二进制
86-
├── start.sh # 设置 lib/ 路径并启动二进制
87-
├── lib/ # 随包发布的非平台动态依赖
94+
├── webman-server # 启动包装脚本(自动载入 php.ini 与底层动态库)
95+
├── start.sh # 标准 Workerman 启动脚本
96+
├── libphp.so # PHP 核心运行时共享库
97+
├── libphpx.so # PHPX 运行时共享库
98+
├── php.ini # 自包含纯净 PHP 运行时配置
99+
├── ext/ # 随包分发的 PHP 核心与网络扩展模块 (.so)
100+
├── lib/ # 随包发布的底层系统与扩展动态依赖库 (ldd 完整收集)
101+
├── runtime/ # 运行时缓存与日志目录 (logs, views)
88102
├── build-manifest.json # 输入、镜像与时间等构建元数据
89103
├── config/ # 项目运行时配置(若存在)
90104
├── public/ # 静态资源(若存在)
91105
└── app/view/ # 视图模板(若存在)
92106
```
93107

94-
`lib/` 只携带构建所需的非平台动态库;glibc、动态加载器以及标准 C/C++ 运行库由目标系统提供。`build-manifest.json` 用于追踪构建,不应写入密钥、令牌或其他敏感信息。
108+
`lib/` 携带构建及扩展所需的所有动态依赖库;glibc、动态加载器由目标系统提供。`build-manifest.json` 用于追踪构建,不应写入密钥、令牌或其他敏感信息。
95109

96110
## 🛠️ 命令
97111

98112
| 命令 | 说明 |
99113
| --- | --- |
100114
| `php webman typephp:package` | 使用默认 builder 构建 Linux portable-dir |
101115
| `php webman typephp:package --force` | 覆盖已有输出,并保留旧目录备份 |
116+
| `php webman typephp:package --refresh-main` | 强制从最新官方 stub 刷新 `main.php`(旧文件自动备份) |
102117
| `php webman typephp:package --image=...` | 使用指定且经过验证的 Docker 镜像 |
103118
| `php webman typephp:doctor` | 检查 PHP、Docker 和构建前置条件 |
104119
| `php webman typephp:init-ci` | 生成 Linux amd64 GitHub Actions 工作流 |
@@ -112,7 +127,7 @@ return [
112127
'enable' => true,
113128
'docker' => [
114129
'enabled' => true,
115-
'image' => 'tinywan/typephp-webman-builder:v0.0.10',
130+
'image' => 'tinywan/typephp-webman-builder:v0.0.16',
116131
],
117132
'build' => [
118133
'output_name' => 'webman-server',

‎src/config/plugin/tinywan/typephp/app.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// Docker 编译环境配置
1313
'docker' => [
1414
'enabled' => true,
15-
'image' => 'tinywan/typephp-webman-builder:v0.0.13',
15+
'image' => 'tinywan/typephp-webman-builder:v0.0.16',
1616
],
1717
// 默认输出配置
1818
'build' => [

0 commit comments

Comments
 (0)