Skip to content

Commit c564c3f

Browse files
authored
fix: minor docs fixes
1 parent 6ab8350 commit c564c3f

3 files changed

Lines changed: 21 additions & 22 deletions

File tree

β€Ždocs/compile.mdβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ brew link --overwrite --force shivammathur/php/php-zts
2525
### By Compiling PHP
2626

2727
Alternatively, you can compile PHP from sources with the options needed by FrankenPHP by following these steps.
28-
~~
29-
~~First, [get the PHP sources](https://www.php.net/downloads.php) and extract them:
28+
29+
First, [get the PHP sources](https://www.php.net/downloads.php) and extract them:
3030

3131
```console
3232
tar xf php-*

β€Ždocs/config.mdβ€Ž

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ You can specify a custom path with the `-c` or `--config` option.
88

99
PHP itself can be configured [using a `php.ini` file](https://www.php.net/manual/en/configuration.file.php).
1010

11-
Depending on your installation method, the PHP interpreter will look for configuration files in locations described above.
11+
Depending on your installation method, the PHP interpreter will look for configuration files in locations described below.
1212

1313
## Docker
1414

@@ -55,8 +55,7 @@ localhost {
5555
}
5656
```
5757

58-
You can also explicitly configure FrankenPHP using the global option:
59-
The `frankenphp` [global option](https://caddyserver.com/docs/caddyfile/concepts#global-options) can be used to configure FrankenPHP.
58+
You can also explicitly configure FrankenPHP using the [global option](https://caddyserver.com/docs/caddyfile/concepts#global-options) `frankenphp`:
6059

6160
```caddyfile
6261
{

β€Ždocs/extensions.mdβ€Ž

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -81,19 +81,19 @@ While the first point speaks for itself, the second may be harder to apprehend.
8181

8282
While some variable types have the same memory representation between C/PHP and Go, some types require more logic to be directly used. This is maybe the hardest part when it comes to writing extensions because it requires understanding internals of the Zend Engine and how variables are stored internally in PHP. This table summarizes what you need to know:
8383

84-
| PHP type | Go type | Direct conversion | C to Go helper | Go to C helper | Class Methods Support |
85-
|--------------------|-------------------------------|-------------------|---------------------------------|----------------------------------|-----------------------|
86-
| `int` | `int64` | βœ… | - | - | βœ… |
87-
| `?int` | `*int64` | βœ… | - | - | βœ… |
88-
| `float` | `float64` | βœ… | - | - | βœ… |
89-
| `?float` | `*float64` | βœ… | - | - | βœ… |
90-
| `bool` | `bool` | βœ… | - | - | βœ… |
91-
| `?bool` | `*bool` | βœ… | - | - | βœ… |
92-
| `string`/`?string` | `*C.zend_string` | ❌ | frankenphp.GoString() | frankenphp.PHPString() | βœ… |
93-
| `array` | `frankenphp.AssociativeArray` | ❌ | frankenphp.GoAssociativeArray() | frankenphp.PHPAssociativeArray() | βœ… |
94-
| `array` | `map[string]any` | ❌ | frankenphp.GoMap() | frankenphp.PHPMap() | βœ… |
95-
| `array` | `[]any` | ❌ | frankenphp.GoPackedArray() | frankenphp.PHPPackedArray() | βœ… |
96-
| `object` | `struct` | ❌ | _Not yet implemented_ | _Not yet implemented_ | ❌ |
84+
| PHP type | Go type | Direct conversion | C to Go helper | Go to C helper | Class Methods Support |
85+
|--------------------|-------------------------------|-------------------|-----------------------------------|------------------------------------|-----------------------|
86+
| `int` | `int64` | βœ… | - | - | βœ… |
87+
| `?int` | `*int64` | βœ… | - | - | βœ… |
88+
| `float` | `float64` | βœ… | - | - | βœ… |
89+
| `?float` | `*float64` | βœ… | - | - | βœ… |
90+
| `bool` | `bool` | βœ… | - | - | βœ… |
91+
| `?bool` | `*bool` | βœ… | - | - | βœ… |
92+
| `string`/`?string` | `*C.zend_string` | ❌ | `frankenphp.GoString()` | `frankenphp.PHPString()` | βœ… |
93+
| `array` | `frankenphp.AssociativeArray` | ❌ | `frankenphp.GoAssociativeArray()` | `frankenphp.PHPAssociativeArray()` | βœ… |
94+
| `array` | `map[string]any` | ❌ | `frankenphp.GoMap()` | `frankenphp.PHPMap()` | βœ… |
95+
| `array` | `[]any` | ❌ | `frankenphp.GoPackedArray()` | `frankenphp.PHPPackedArray()` | βœ… |
96+
| `object` | `struct` | ❌ | _Not yet implemented_ | _Not yet implemented_ | ❌ |
9797

9898
> [!NOTE]
9999
> This table is not exhaustive yet and will be completed as the FrankenPHP types API gets more complete.
@@ -125,7 +125,7 @@ func process_data_ordered_map(arr *C.zval) unsafe.Pointer {
125125
}
126126

127127
// return an ordered array
128-
// if 'Order' is not empty, only the key-value paris in 'Order' will be respected
128+
// if 'Order' is not empty, only the key-value pairs in 'Order' will be respected
129129
return frankenphp.PHPAssociativeArray(AssociativeArray{
130130
Map: map[string]any{
131131
"key1": "value1",
@@ -181,9 +181,9 @@ func process_data_packed(arr *C.zval) unsafe.Pointer {
181181
* `frankenphp.PHPAssociativeArray(arr frankenphp.AssociativeArray) unsafe.Pointer` - Convert to an ordered PHP array with key-value pairs
182182
* `frankenphp.PHPMap(arr map[string]any) unsafe.Pointer` - Convert a map to an unordered PHP array with key-value pairs
183183
* `frankenphp.PHPPackedArray(slice []any) unsafe.Pointer` - Convert a slice to a PHP packed array with indexed values only
184-
* `frankenphp.GoAssociativeArray(arr unsafe.Pointer, ordered bool) frankenphp.AssociativeArray` - Convert a PHP array to an ordered Go AssociativeArray (map with order)
185-
* `frankenphp.GoMap(arr unsafe.Pointer) map[string]any` - Convert a PHP array to an unordered go map
186-
* `frankenphp.GoPackedArray(arr unsafe.Pointer) []any` - Convert a PHP array to a go slice
184+
* `frankenphp.GoAssociativeArray(arr unsafe.Pointer, ordered bool) frankenphp.AssociativeArray` - Convert a PHP array to an ordered Go `AssociativeArray` (map with order)
185+
* `frankenphp.GoMap(arr unsafe.Pointer) map[string]any` - Convert a PHP array to an unordered Go map
186+
* `frankenphp.GoPackedArray(arr unsafe.Pointer) []any` - Convert a PHP array to a Go slice
187187

188188
### Declaring a Native PHP Class
189189

0 commit comments

Comments
Β (0)