Skip to content

Commit 52fbda0

Browse files
committed
chore: run prettier
1 parent 7f8e43f commit 52fbda0

58 files changed

Lines changed: 2010 additions & 2007 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/dependabot.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ updates:
1010
groups:
1111
go-modules:
1212
patterns:
13-
- '*'
13+
- "*"
1414
- package-ecosystem: gomod
1515
directory: /caddy
1616
schedule:
@@ -25,7 +25,7 @@ updates:
2525
groups:
2626
go-modules:
2727
patterns:
28-
- '*'
28+
- "*"
2929
- package-ecosystem: github-actions
3030
directory: /
3131
schedule:
@@ -35,4 +35,4 @@ updates:
3535
groups:
3636
github-actions:
3737
patterns:
38-
- '*'
38+
- "*"

CONTRIBUTING.md

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -111,22 +111,22 @@ docker buildx bake -f docker-bake.hcl --pull --no-cache --push
111111

112112
1. Download the debug version of the FrankenPHP binary from GitHub or create your custom static build including debug symbols:
113113

114-
```console
115-
docker buildx bake \
116-
--load \
117-
--set static-builder.args.DEBUG_SYMBOLS=1 \
118-
--set "static-builder.platform=linux/amd64" \
119-
static-builder
120-
docker cp $(docker create --name static-builder-musl dunglas/frankenphp:static-builder-musl):/go/src/app/dist/frankenphp-linux-$(uname -m) frankenphp
121-
```
114+
```console
115+
docker buildx bake \
116+
--load \
117+
--set static-builder.args.DEBUG_SYMBOLS=1 \
118+
--set "static-builder.platform=linux/amd64" \
119+
static-builder
120+
docker cp $(docker create --name static-builder-musl dunglas/frankenphp:static-builder-musl):/go/src/app/dist/frankenphp-linux-$(uname -m) frankenphp
121+
```
122122

123123
2. Replace your current version of `frankenphp` by the debug FrankenPHP executable
124124
3. Start FrankenPHP as usual (alternatively, you can directly start FrankenPHP with GDB: `gdb --args frankenphp run`)
125125
4. Attach to the process with GDB:
126126

127-
```console
128-
gdb -p `pidof frankenphp`
129-
```
127+
```console
128+
gdb -p `pidof frankenphp`
129+
```
130130

131131
5. If necessary, type `continue` in the GDB shell
132132
6. Make FrankenPHP crash
@@ -138,60 +138,60 @@ docker buildx bake -f docker-bake.hcl --pull --no-cache --push
138138
1. Open `.github/workflows/tests.yml`
139139
2. Enable PHP debug symbols
140140

141-
```patch
142-
- uses: shivammathur/setup-php@v2
143-
# ...
144-
env:
145-
phpts: ts
146-
+ debug: true
147-
```
141+
```patch
142+
- uses: shivammathur/setup-php@v2
143+
# ...
144+
env:
145+
phpts: ts
146+
+ debug: true
147+
```
148148

149149
3. Enable `tmate` to connect to the container
150150

151-
```patch
152-
- name: Set CGO flags
153-
run: echo "CGO_CFLAGS=$(php-config --includes)" >> "$GITHUB_ENV"
154-
+ - run: |
155-
+ sudo apt install gdb
156-
+ mkdir -p /home/runner/.config/gdb/
157-
+ printf "set auto-load safe-path /\nhandle SIG34 nostop noprint pass" > /home/runner/.config/gdb/gdbinit
158-
+ - uses: mxschmitt/action-tmate@v3
159-
```
151+
```patch
152+
- name: Set CGO flags
153+
run: echo "CGO_CFLAGS=$(php-config --includes)" >> "$GITHUB_ENV"
154+
+ - run: |
155+
+ sudo apt install gdb
156+
+ mkdir -p /home/runner/.config/gdb/
157+
+ printf "set auto-load safe-path /\nhandle SIG34 nostop noprint pass" > /home/runner/.config/gdb/gdbinit
158+
+ - uses: mxschmitt/action-tmate@v3
159+
```
160160

161161
4. Connect to the container
162162
5. Open `frankenphp.go`
163163
6. Enable `cgosymbolizer`
164164

165-
```patch
166-
- //_ "github.com/ianlancetaylor/cgosymbolizer"
167-
+ _ "github.com/ianlancetaylor/cgosymbolizer"
168-
```
165+
```patch
166+
- //_ "github.com/ianlancetaylor/cgosymbolizer"
167+
+ _ "github.com/ianlancetaylor/cgosymbolizer"
168+
```
169169

170170
7. Download the module: `go get`
171171
8. In the container, you can use GDB and the like:
172172

173-
```console
174-
go test -tags watcher -c -ldflags=-w
175-
gdb --args frankenphp.test -test.run ^MyTest$
176-
```
173+
```console
174+
go test -tags watcher -c -ldflags=-w
175+
gdb --args frankenphp.test -test.run ^MyTest$
176+
```
177177

178178
9. When the bug is fixed, revert all these changes
179179

180180
## Misc Dev Resources
181181

182-
* [PHP embedding in uWSGI](https://github.com/unbit/uwsgi/blob/master/plugins/php/php_plugin.c)
183-
* [PHP embedding in NGINX Unit](https://github.com/nginx/unit/blob/master/src/nxt_php_sapi.c)
184-
* [PHP embedding in Go (go-php)](https://github.com/deuill/go-php)
185-
* [PHP embedding in Go (GoEmPHP)](https://github.com/mikespook/goemphp)
186-
* [PHP embedding in C++](https://gist.github.com/paresy/3cbd4c6a469511ac7479aa0e7c42fea7)
187-
* [Extending and Embedding PHP by Sara Golemon](https://books.google.fr/books?id=zMbGvK17_tYC&pg=PA254&lpg=PA254#v=onepage&q&f=false)
188-
* [What the heck is TSRMLS_CC, anyway?](http://blog.golemon.com/2006/06/what-heck-is-tsrmlscc-anyway.html)
189-
* [SDL bindings](https://pkg.go.dev/github.com/veandco/go-sdl2@v0.4.21/sdl#Main)
182+
- [PHP embedding in uWSGI](https://github.com/unbit/uwsgi/blob/master/plugins/php/php_plugin.c)
183+
- [PHP embedding in NGINX Unit](https://github.com/nginx/unit/blob/master/src/nxt_php_sapi.c)
184+
- [PHP embedding in Go (go-php)](https://github.com/deuill/go-php)
185+
- [PHP embedding in Go (GoEmPHP)](https://github.com/mikespook/goemphp)
186+
- [PHP embedding in C++](https://gist.github.com/paresy/3cbd4c6a469511ac7479aa0e7c42fea7)
187+
- [Extending and Embedding PHP by Sara Golemon](https://books.google.fr/books?id=zMbGvK17_tYC&pg=PA254&lpg=PA254#v=onepage&q&f=false)
188+
- [What the heck is TSRMLS_CC, anyway?](http://blog.golemon.com/2006/06/what-heck-is-tsrmlscc-anyway.html)
189+
- [SDL bindings](https://pkg.go.dev/github.com/veandco/go-sdl2@v0.4.21/sdl#Main)
190190

191191
## Docker-Related Resources
192192

193-
* [Bake file definition](https://docs.docker.com/build/customize/bake/file-definition/)
194-
* [docker buildx build](https://docs.docker.com/engine/reference/commandline/buildx_build/)
193+
- [Bake file definition](https://docs.docker.com/build/customize/bake/file-definition/)
194+
- [docker buildx build](https://docs.docker.com/engine/reference/commandline/buildx_build/)
195195

196196
## Useful Command
197197

README.md

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55
FrankenPHP is a modern application server for PHP built on top of the [Caddy](https://caddyserver.com/) web server.
66

7-
FrankenPHP gives superpowers to your PHP apps thanks to its stunning features: [*Early Hints*](https://frankenphp.dev/docs/early-hints/), [worker mode](https://frankenphp.dev/docs/worker/), [real-time capabilities](https://frankenphp.dev/docs/mercure/), automatic HTTPS, HTTP/2, and HTTP/3 support...
7+
FrankenPHP gives superpowers to your PHP apps thanks to its stunning features: [_Early Hints_](https://frankenphp.dev/docs/early-hints/), [worker mode](https://frankenphp.dev/docs/worker/), [real-time capabilities](https://frankenphp.dev/docs/mercure/), automatic HTTPS, HTTP/2, and HTTP/3 support...
88

99
FrankenPHP works with any PHP app and makes your Laravel and Symfony projects faster than ever thanks to their official integrations with the worker mode.
1010

1111
FrankenPHP can also be used as a standalone Go library to embed PHP in any app using `net/http`.
1212

13-
[**Learn more** on *frankenphp.dev*](https://frankenphp.dev) and in this slide deck:
13+
[**Learn more** on _frankenphp.dev_](https://frankenphp.dev) and in this slide deck:
1414

1515
<a href="https://dunglas.dev/2022/10/frankenphp-the-modern-php-app-server-written-in-go/"><img src="https://dunglas.dev/wp-content/uploads/2022/10/frankenphp.png" alt="Slides" width="600"></a>
1616

@@ -84,33 +84,33 @@ frankenphp php-server
8484

8585
## Docs
8686

87-
* [Classic mode](https://frankenphp.dev/docs/classic/)
88-
* [Worker mode](https://frankenphp.dev/docs/worker/)
89-
* [Early Hints support (103 HTTP status code)](https://frankenphp.dev/docs/early-hints/)
90-
* [Real-time](https://frankenphp.dev/docs/mercure/)
91-
* [Efficiently Serving Large Static Files](https://frankenphp.dev/docs/x-sendfile/)
92-
* [Configuration](https://frankenphp.dev/docs/config/)
93-
* [Docker images](https://frankenphp.dev/docs/docker/)
94-
* [Deploy in production](https://frankenphp.dev/docs/production/)
95-
* [Performance optimization](https://frankenphp.dev/docs/performance/)
96-
* [Create **standalone**, self-executable PHP apps](https://frankenphp.dev/docs/embed/)
97-
* [Create static binaries](https://frankenphp.dev/docs/static/)
98-
* [Compile from sources](https://frankenphp.dev/docs/compile/)
99-
* [Monitoring FrankenPHP](https://frankenphp.dev/docs/metrics/)
100-
* [Laravel integration](https://frankenphp.dev/docs/laravel/)
101-
* [Known issues](https://frankenphp.dev/docs/known-issues/)
102-
* [Demo app (Symfony) and benchmarks](https://github.com/dunglas/frankenphp-demo)
103-
* [Go library documentation](https://pkg.go.dev/github.com/dunglas/frankenphp)
104-
* [Contributing and debugging](https://frankenphp.dev/docs/contributing/)
87+
- [Classic mode](https://frankenphp.dev/docs/classic/)
88+
- [Worker mode](https://frankenphp.dev/docs/worker/)
89+
- [Early Hints support (103 HTTP status code)](https://frankenphp.dev/docs/early-hints/)
90+
- [Real-time](https://frankenphp.dev/docs/mercure/)
91+
- [Efficiently Serving Large Static Files](https://frankenphp.dev/docs/x-sendfile/)
92+
- [Configuration](https://frankenphp.dev/docs/config/)
93+
- [Docker images](https://frankenphp.dev/docs/docker/)
94+
- [Deploy in production](https://frankenphp.dev/docs/production/)
95+
- [Performance optimization](https://frankenphp.dev/docs/performance/)
96+
- [Create **standalone**, self-executable PHP apps](https://frankenphp.dev/docs/embed/)
97+
- [Create static binaries](https://frankenphp.dev/docs/static/)
98+
- [Compile from sources](https://frankenphp.dev/docs/compile/)
99+
- [Monitoring FrankenPHP](https://frankenphp.dev/docs/metrics/)
100+
- [Laravel integration](https://frankenphp.dev/docs/laravel/)
101+
- [Known issues](https://frankenphp.dev/docs/known-issues/)
102+
- [Demo app (Symfony) and benchmarks](https://github.com/dunglas/frankenphp-demo)
103+
- [Go library documentation](https://pkg.go.dev/github.com/dunglas/frankenphp)
104+
- [Contributing and debugging](https://frankenphp.dev/docs/contributing/)
105105

106106
## Examples and Skeletons
107107

108-
* [Symfony](https://github.com/dunglas/symfony-docker)
109-
* [API Platform](https://api-platform.com/docs/symfony)
110-
* [Laravel](https://frankenphp.dev/docs/laravel/)
111-
* [Sulu](https://sulu.io/blog/running-sulu-with-frankenphp)
112-
* [WordPress](https://github.com/StephenMiracle/frankenwp)
113-
* [Drupal](https://github.com/dunglas/frankenphp-drupal)
114-
* [Joomla](https://github.com/alexandreelise/frankenphp-joomla)
115-
* [TYPO3](https://github.com/ochorocho/franken-typo3)
116-
* [Magento2](https://github.com/ekino/frankenphp-magento2)
108+
- [Symfony](https://github.com/dunglas/symfony-docker)
109+
- [API Platform](https://api-platform.com/docs/symfony)
110+
- [Laravel](https://frankenphp.dev/docs/laravel/)
111+
- [Sulu](https://sulu.io/blog/running-sulu-with-frankenphp)
112+
- [WordPress](https://github.com/StephenMiracle/frankenwp)
113+
- [Drupal](https://github.com/dunglas/frankenphp-drupal)
114+
- [Joomla](https://github.com/alexandreelise/frankenphp-joomla)
115+
- [TYPO3](https://github.com/ochorocho/franken-typo3)
116+
- [Magento2](https://github.com/ekino/frankenphp-magento2)

docs/cn/CONTRIBUTING.md

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -108,22 +108,22 @@ docker buildx bake -f docker-bake.hcl --pull --no-cache --push
108108

109109
1. 从 GitHub 下载 FrankenPHP 二进制文件的调试版本或创建包含调试符号的自定义静态构建:
110110

111-
```console
112-
docker buildx bake \
113-
--load \
114-
--set static-builder.args.DEBUG_SYMBOLS=1 \
115-
--set "static-builder.platform=linux/amd64" \
116-
static-builder
117-
docker cp $(docker create --name static-builder-musl dunglas/frankenphp:static-builder-musl):/go/src/app/dist/frankenphp-linux-$(uname -m) frankenphp
118-
```
111+
```console
112+
docker buildx bake \
113+
--load \
114+
--set static-builder.args.DEBUG_SYMBOLS=1 \
115+
--set "static-builder.platform=linux/amd64" \
116+
static-builder
117+
docker cp $(docker create --name static-builder-musl dunglas/frankenphp:static-builder-musl):/go/src/app/dist/frankenphp-linux-$(uname -m) frankenphp
118+
```
119119

120120
2. 将当前版本的 `frankenphp` 替换为 debug FrankenPHP 可执行文件
121121
3. 照常启动 FrankenPHP(或者,你可以直接使用 GDB 启动 FrankenPHP: `gdb --args frankenphp run`
122122
4. 使用 GDB 附加到进程:
123123

124-
```console
125-
gdb -p `pidof frankenphp`
126-
```
124+
```console
125+
gdb -p `pidof frankenphp`
126+
```
127127

128128
5. 如有必要,请在 GDB shell 中输入 `continue`
129129
6. 使 FrankenPHP 崩溃
@@ -135,64 +135,64 @@ docker buildx bake -f docker-bake.hcl --pull --no-cache --push
135135
1. 打开 `.github/workflows/tests.yml`
136136
2. 启用 PHP 调试符号
137137

138-
```patch
139-
- uses: shivammathur/setup-php@v2
140-
# ...
141-
env:
142-
phpts: ts
143-
+ debug: true
144-
```
138+
```patch
139+
- uses: shivammathur/setup-php@v2
140+
# ...
141+
env:
142+
phpts: ts
143+
+ debug: true
144+
```
145145

146146
3. 启用 `tmate` 以连接到容器
147147

148-
```patch
149-
-
150-
name: Set CGO flags
151-
run: echo "CGO_CFLAGS=$(php-config --includes)" >> "$GITHUB_ENV"
152-
+ -
153-
+ run: |
154-
+ sudo apt install gdb
155-
+ mkdir -p /home/runner/.config/gdb/
156-
+ printf "set auto-load safe-path /\nhandle SIG34 nostop noprint pass" > /home/runner/.config/gdb/gdbinit
157-
+ -
158-
+ uses: mxschmitt/action-tmate@v3
159-
```
148+
```patch
149+
-
150+
name: Set CGO flags
151+
run: echo "CGO_CFLAGS=$(php-config --includes)" >> "$GITHUB_ENV"
152+
+ -
153+
+ run: |
154+
+ sudo apt install gdb
155+
+ mkdir -p /home/runner/.config/gdb/
156+
+ printf "set auto-load safe-path /\nhandle SIG34 nostop noprint pass" > /home/runner/.config/gdb/gdbinit
157+
+ -
158+
+ uses: mxschmitt/action-tmate@v3
159+
```
160160

161161
4. 连接到容器
162162
5. 打开 `frankenphp.go`
163163
6. 启用 `cgosymbolizer`
164164

165-
```patch
166-
- //_ "github.com/ianlancetaylor/cgosymbolizer"
167-
+ _ "github.com/ianlancetaylor/cgosymbolizer"
168-
```
165+
```patch
166+
- //_ "github.com/ianlancetaylor/cgosymbolizer"
167+
+ _ "github.com/ianlancetaylor/cgosymbolizer"
168+
```
169169

170170
7. 下载模块: `go get`
171171
8. 在容器中,可以使用 GDB 和以下:
172172

173-
```console
174-
go test -tags watcher -c -ldflags=-w
175-
gdb --args frankenphp.test -test.run ^MyTest$
176-
```
173+
```console
174+
go test -tags watcher -c -ldflags=-w
175+
gdb --args frankenphp.test -test.run ^MyTest$
176+
```
177177

178178
9. 当错误修复后,恢复所有这些更改
179179

180180
## 其他开发资源
181181

182-
* [PHP 嵌入 uWSGI](https://github.com/unbit/uwsgi/blob/master/plugins/php/php_plugin.c)
183-
* [PHP 嵌入 NGINX Unit](https://github.com/nginx/unit/blob/master/src/nxt_php_sapi.c)
184-
* [PHP 嵌入 Go (go-php)](https://github.com/deuill/go-php)
185-
* [PHP 嵌入 Go (GoEmPHP)](https://github.com/mikespook/goemphp)
186-
* [PHP 嵌入 C++](https://gist.github.com/paresy/3cbd4c6a469511ac7479aa0e7c42fea7)
187-
* [扩展和嵌入 PHP 作者:Sara Golemon](https://books.google.fr/books?id=zMbGvK17_tYC&pg=PA254&lpg=PA254#v=onepage&q&f=false)
188-
* [TSRMLS_CC到底是什么?](http://blog.golemon.com/2006/06/what-heck-is-tsrmlscc-anyway.html)
189-
* [Mac 上的 PHP 嵌入](https://gist.github.com/jonnywang/61427ffc0e8dde74fff40f479d147db4)
190-
* [SDL 绑定](https://pkg.go.dev/github.com/veandco/go-sdl2@v0.4.21/sdl#Main)
182+
- [PHP 嵌入 uWSGI](https://github.com/unbit/uwsgi/blob/master/plugins/php/php_plugin.c)
183+
- [PHP 嵌入 NGINX Unit](https://github.com/nginx/unit/blob/master/src/nxt_php_sapi.c)
184+
- [PHP 嵌入 Go (go-php)](https://github.com/deuill/go-php)
185+
- [PHP 嵌入 Go (GoEmPHP)](https://github.com/mikespook/goemphp)
186+
- [PHP 嵌入 C++](https://gist.github.com/paresy/3cbd4c6a469511ac7479aa0e7c42fea7)
187+
- [扩展和嵌入 PHP 作者:Sara Golemon](https://books.google.fr/books?id=zMbGvK17_tYC&pg=PA254&lpg=PA254#v=onepage&q&f=false)
188+
- [TSRMLS_CC到底是什么?](http://blog.golemon.com/2006/06/what-heck-is-tsrmlscc-anyway.html)
189+
- [Mac 上的 PHP 嵌入](https://gist.github.com/jonnywang/61427ffc0e8dde74fff40f479d147db4)
190+
- [SDL 绑定](https://pkg.go.dev/github.com/veandco/go-sdl2@v0.4.21/sdl#Main)
191191

192192
## Docker 相关资源
193193

194-
* [Bake 文件定义](https://docs.docker.com/build/customize/bake/file-definition/)
195-
* [docker buildx 构建](https://docs.docker.com/engine/reference/commandline/buildx_build/)
194+
- [Bake 文件定义](https://docs.docker.com/build/customize/bake/file-definition/)
195+
- [docker buildx 构建](https://docs.docker.com/engine/reference/commandline/buildx_build/)
196196

197197
## 有用的命令
198198

0 commit comments

Comments
 (0)