Skip to content

Commit 3662c7d

Browse files
committed
CS
Updated notes regarding the `GEN_STUB_SCRIPT` environment variable and clarified that the source file is never modified. Added emphasis on naming conventions for PHP constants. Signed-off-by: Kévin Dunglas <kevin@dunglas.fr>
1 parent 401a212 commit 3662c7d

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

docs/extensions.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ GEN_STUB_SCRIPT=php-src/build/gen_stub.php frankenphp extension-init my_extensio
9191
```
9292

9393
> [!NOTE]
94+
>
9495
> Don't forget to set the `GEN_STUB_SCRIPT` environment variable to the path of the `gen_stub.php` file in the PHP sources you downloaded earlier. This is the same `gen_stub.php` script mentioned in the manual implementation section.
9596
9697
If everything went well, your project directory should contain the following files for your extension:
@@ -103,7 +104,9 @@ If everything went well, your project directory should contain the following fil
103104
- **`my_extension.c`** - C implementation file
104105
- **`README.md`** - Documentation
105106

106-
> [!IMPORTANT] > **Your source file (`my_extension.go`) is never modified.** The generator creates a separate `_generated.go` file containing CGO wrappers that call your original functions. This means you can safely version control your source file without worrying about generated code polluting it.
107+
> [!IMPORTANT]
108+
>
109+
> **Your source file (`my_extension.go`) is never modified.** The generator creates a separate `_generated.go` file containing CGO wrappers that call your original functions. This means you can safely version control your source file without worrying about generated code polluting it.
107110
108111
### Integrating the Generated Extension into FrankenPHP
109112

@@ -470,6 +473,7 @@ const (
470473
```
471474

472475
> [!NOTE]
476+
>
473477
> PHP constants will take the name of the Go constant, thus using upper case letters is recommended.
474478
475479
#### Class Constants
@@ -497,6 +501,7 @@ const (
497501
```
498502

499503
> [!NOTE]
504+
>
500505
> Just like global constants, the class constants will take the name of the Go constant.
501506
502507
Class constants are accessible using the class name scope in PHP:

0 commit comments

Comments
 (0)