Skip to content

Commit ffa52f7

Browse files
committed
chore: run prettier
1 parent 4550027 commit ffa52f7

50 files changed

Lines changed: 1870 additions & 1867 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/compile.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Some FrankenPHP features depend on optional system dependencies that must be ins
6767
Alternatively, these features can be disabled by passing build tags to the Go compiler.
6868

6969
| Feature | Dependency | Build tag to disable it |
70-
|--------------------------------|-----------------------------------------------------------------------|-------------------------|
70+
| ------------------------------ | --------------------------------------------------------------------- | ----------------------- |
7171
| Brotli compression | [Brotli](https://github.com/google/brotli) | nobrotli |
7272
| Restart workers on file change | [Watcher C](https://github.com/e-dant/watcher/tree/release/watcher-c) | nowatcher |
7373

docs/config.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,10 @@ where the FrankenPHP process was started. You can instead also specify one or mo
179179
}
180180
```
181181

182-
* The `**` pattern signifies recursive watching
183-
* Directories can also be relative (to where the FrankenPHP process is started from)
184-
* If you have multiple workers defined, all of them will be restarted when a file changes
185-
* Be wary about watching files that are created at runtime (like logs) since they might cause unwanted worker restarts.
182+
- The `**` pattern signifies recursive watching
183+
- Directories can also be relative (to where the FrankenPHP process is started from)
184+
- If you have multiple workers defined, all of them will be restarted when a file changes
185+
- Be wary about watching files that are created at runtime (like logs) since they might cause unwanted worker restarts.
186186

187187
The file watcher is based on [e-dant/watcher](https://github.com/e-dant/watcher).
188188

@@ -218,9 +218,9 @@ You can find more information about this setting in the [Caddy documentation](ht
218218

219219
The following environment variables can be used to inject Caddy directives in the `Caddyfile` without modifying it:
220220

221-
* `SERVER_NAME`: change [the addresses on which to listen](https://caddyserver.com/docs/caddyfile/concepts#addresses), the provided hostnames will also be used for the generated TLS certificate
222-
* `CADDY_GLOBAL_OPTIONS`: inject [global options](https://caddyserver.com/docs/caddyfile/options)
223-
* `FRANKENPHP_CONFIG`: inject config under the `frankenphp` directive
221+
- `SERVER_NAME`: change [the addresses on which to listen](https://caddyserver.com/docs/caddyfile/concepts#addresses), the provided hostnames will also be used for the generated TLS certificate
222+
- `CADDY_GLOBAL_OPTIONS`: inject [global options](https://caddyserver.com/docs/caddyfile/options)
223+
- `FRANKENPHP_CONFIG`: inject config under the `frankenphp` directive
224224

225225
As for FPM and CLI SAPIs, environment variables are exposed by default in the `$_SERVER` superglobal.
226226

docs/docker.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ Variants for PHP 8.2, 8.3 and 8.4 are provided.
66

77
The tags follow this pattern: `dunglas/frankenphp:<frankenphp-version>-php<php-version>-<os>`
88

9-
* `<frankenphp-version>` and `<php-version>` are version numbers of FrankenPHP and PHP respectively, ranging from major (e.g. `1`), minor (e.g. `1.2`) to patch versions (e.g. `1.2.3`).
10-
* `<os>` is either `bookworm` (for Debian Bookworm) or `alpine` (for the latest stable version of Alpine).
9+
- `<frankenphp-version>` and `<php-version>` are version numbers of FrankenPHP and PHP respectively, ranging from major (e.g. `1`), minor (e.g. `1.2`) to patch versions (e.g. `1.2.3`).
10+
- `<os>` is either `bookworm` (for Debian Bookworm) or `alpine` (for the latest stable version of Alpine).
1111

1212
[Browse tags](https://hub.docker.com/r/dunglas/frankenphp/tags).
1313

@@ -193,8 +193,8 @@ Example: `:8000`
193193

194194
The Docker images are built:
195195

196-
* when a new release is tagged
197-
* daily at 4 am UTC, if new versions of the official PHP images are available
196+
- when a new release is tagged
197+
- daily at 4 am UTC, if new versions of the official PHP images are available
198198

199199
## Development Versions
200200

docs/embed.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ Before creating the self-contained binary be sure that your app is ready for emb
1414

1515
For instance, you likely want to:
1616

17-
* Install the production dependencies of the app
18-
* Dump the autoloader
19-
* Enable the production mode of your application (if any)
20-
* Strip unneeded files such as `.git` or tests to reduce the size of your final binary
17+
- Install the production dependencies of the app
18+
- Dump the autoloader
19+
- Enable the production mode of your application (if any)
20+
- Strip unneeded files such as `.git` or tests to reduce the size of your final binary
2121

2222
For instance, for a Symfony app, you can use the following commands:
2323

@@ -53,34 +53,34 @@ The easiest way to create a Linux binary is to use the Docker-based builder we p
5353

5454
1. Create a file named `static-build.Dockerfile` in the repository of your app:
5555

56-
```dockerfile
57-
FROM --platform=linux/amd64 dunglas/frankenphp:static-builder
56+
```dockerfile
57+
FROM --platform=linux/amd64 dunglas/frankenphp:static-builder
5858

59-
# Copy your app
60-
WORKDIR /go/src/app/dist/app
61-
COPY . .
59+
# Copy your app
60+
WORKDIR /go/src/app/dist/app
61+
COPY . .
6262

63-
# Build the static binary
64-
WORKDIR /go/src/app/
65-
RUN EMBED=dist/app/ ./build-static.sh
66-
```
63+
# Build the static binary
64+
WORKDIR /go/src/app/
65+
RUN EMBED=dist/app/ ./build-static.sh
66+
```
6767

68-
> [!CAUTION]
69-
>
70-
> Some `.dockerignore` files (e.g. default [Symfony Docker `.dockerignore`](https://github.com/dunglas/symfony-docker/blob/main/.dockerignore))
71-
> will ignore the `vendor/` directory and `.env` files. Be sure to adjust or remove the `.dockerignore` file before the build.
68+
> [!CAUTION]
69+
>
70+
> Some `.dockerignore` files (e.g. default [Symfony Docker `.dockerignore`](https://github.com/dunglas/symfony-docker/blob/main/.dockerignore))
71+
> will ignore the `vendor/` directory and `.env` files. Be sure to adjust or remove the `.dockerignore` file before the build.
7272
7373
2. Build:
7474

75-
```console
76-
docker build -t static-app -f static-build.Dockerfile .
77-
```
75+
```console
76+
docker build -t static-app -f static-build.Dockerfile .
77+
```
7878

7979
3. Extract the binary:
8080

81-
```console
82-
docker cp $(docker create --name static-app-tmp static-app):/go/src/app/dist/frankenphp-linux-x86_64 my-app ; docker rm static-app-tmp
83-
```
81+
```console
82+
docker cp $(docker create --name static-app-tmp static-app):/go/src/app/dist/frankenphp-linux-x86_64 my-app ; docker rm static-app-tmp
83+
```
8484

8585
The resulting binary is the file named `my-app` in the current directory.
8686

0 commit comments

Comments
 (0)