Skip to content

Commit 1fc785e

Browse files
committed
docs: revert heading renames in embed.md and extension-workers.md
Per review, the original heading names already read fine in context: the page title and frontmatter establish the FrankenPHP / extension worker / embedded-app framing, so prefixing every section heading with those qualifiers is redundant. For embed.md, "the Embedded Binary" was also misleading: the binary is the artifact that embeds the user's app, not something that is itself embedded. Restore the main wording for: - ## Using The Binary - ## PHP Extensions - ## Customizing The Build - ## Distributing The Binary - ## Registering the Worker - ### Static Registration - ## Interacting with Workers - ## Worker Script - ## Lifecycle Hooks - ### Example
1 parent bc9bfac commit 1fc785e

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

docs/embed.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ EMBED=/path/to/your/app ./build-static.sh
103103

104104
The resulting binary is the file named `frankenphp-<os>-<arch>` in the `dist/` directory.
105105

106-
## Using the Embedded Binary
106+
## Using The Binary
107107

108108
This is it! The `my-app` file (or `dist/frankenphp-<os>-<arch>` on other OSes) contains your self-contained app!
109109

@@ -131,18 +131,18 @@ You can also run the PHP CLI scripts embedded in your binary:
131131
./my-app php-cli bin/console
132132
```
133133

134-
## PHP Extensions in the Embedded Binary
134+
## PHP Extensions
135135

136136
By default, the script will build extensions required by the `composer.json` file of your project, if any.
137137
If the `composer.json` file doesn't exist, the default extensions are built, as documented in [the static builds entry](static.md).
138138

139139
To customize the extensions, use the `PHP_EXTENSIONS` environment variable.
140140

141-
## Customizing the Embedded Binary Build
141+
## Customizing The Build
142142

143143
[Read the static build documentation](static.md) to see how to customize the binary (extensions, PHP version...).
144144

145-
## Distributing the Embedded Binary
145+
## Distributing The Binary
146146

147147
On Linux, the created binary is compressed using [UPX](https://upx.github.io).
148148

docs/extension-workers.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ description: Use FrankenPHP Extension Workers to run a dedicated PHP thread pool
77

88
Extension Workers enable your [FrankenPHP extension](https://frankenphp.dev/docs/extensions/) to manage a dedicated pool of PHP threads for executing background tasks, handling asynchronous events, or implementing custom protocols. Useful for queue systems, event listeners, schedulers, etc.
99

10-
## Registering a FrankenPHP Extension Worker
10+
## Registering the Worker
1111

12-
### Static Worker Registration
12+
### Static Registration
1313

1414
If you don't need to make the worker configurable by the user (fixed script path, fixed number of threads), you can simply register the worker in the `init()` function.
1515

@@ -47,7 +47,7 @@ If you plan to share your extension (like a generic queue or event listener), yo
4747

4848
If you are [embedding FrankenPHP in a standard Go application without caddy](https://pkg.go.dev/github.com/dunglas/frankenphp#example-ServeHTTP), you can register extension workers using `frankenphp.WithExtensionWorkers` when initializing options.
4949

50-
## Dispatching Tasks to FrankenPHP Extension Workers
50+
## Interacting with Workers
5151

5252
Once the worker pool is active, you can dispatch tasks to it. This can be done inside [native functions exported to PHP](https://frankenphp.dev/docs/extensions/#writing-the-extension), or from any Go logic such as a cron scheduler, an event listener (MQTT, Kafka), or any other goroutine.
5353

@@ -117,7 +117,7 @@ func my_worker_http_request(path *C.zend_string) unsafe.Pointer {
117117
}
118118
```
119119

120-
## FrankenPHP Extension Worker PHP Script
120+
## Worker Script
121121

122122
The PHP worker script runs in a loop and can handle both raw messages and HTTP requests.
123123

@@ -139,7 +139,7 @@ while (frankenphp_handle_request($handler)) {
139139
}
140140
```
141141

142-
## FrankenPHP Extension Worker Lifecycle Hooks
142+
## Lifecycle Hooks
143143

144144
FrankenPHP provides hooks to execute Go code at specific points in the lifecycle.
145145

@@ -150,7 +150,7 @@ FrankenPHP provides hooks to execute Go code at specific points in the lifecycle
150150
| **Thread** | `WithWorkerOnReady` | `func(threadID int)` | Per-thread setup. Called when a thread starts. Receives the Thread ID. |
151151
| **Thread** | `WithWorkerOnShutdown` | `func(threadID int)` | Per-thread cleanup. Receives the Thread ID. |
152152

153-
### Lifecycle Hooks Example
153+
### Example
154154

155155
```go
156156
// FrankenPHP extension worker with lifecycle hooks

0 commit comments

Comments
 (0)