mirror of
https://github.com/php/frankenphp.git
synced 2026-03-24 00:52:11 +01:00
docs: remove fibers from known issues
This commit is contained in:
@@ -1,35 +1,5 @@
|
||||
# 已知问题
|
||||
|
||||
## Fibers
|
||||
|
||||
在 [Fibers](https://www.php.net/manual/en/language.fibers.php) 中调用 PHP 的函数和代码等语言结构,这些结构内部再调用 [cgo](https://go.dev/blog/cgo) 会导致崩溃。
|
||||
|
||||
这个问题 [正在由 Go 项目处理](https://github.com/golang/go/issues/62130)。
|
||||
|
||||
一种解决方案是不要使用从 Fibers 内部委托给 Go 的构造(如 `echo`)和函数(如 `header()`)。
|
||||
|
||||
下面的代码可能会崩溃,因为它在 Fiber 中使用了 `echo`:
|
||||
|
||||
```php
|
||||
$fiber = new Fiber(function() {
|
||||
echo 'In the Fiber'.PHP_EOL;
|
||||
echo 'Still inside'.PHP_EOL;
|
||||
});
|
||||
$fiber->start();
|
||||
```
|
||||
|
||||
相反,请从 Fiber 返回值并在外部使用它:
|
||||
|
||||
```php
|
||||
$fiber = new Fiber(function() {
|
||||
Fiber::suspend('In the Fiber'.PHP_EOL));
|
||||
Fiber::suspend('Still inside'.PHP_EOL));
|
||||
});
|
||||
echo $fiber->start();
|
||||
echo $fiber->resume();
|
||||
$fiber->resume();
|
||||
```
|
||||
|
||||
## 不支持的 PHP 扩展
|
||||
|
||||
已知以下扩展与 FrankenPHP 不兼容:
|
||||
|
||||
@@ -1,35 +1,5 @@
|
||||
# Problèmes Connus
|
||||
|
||||
## Fibres
|
||||
|
||||
Appeller de fonctions et mots clefs PHP qui eux-mêmes appellent [cgo](https://go.dev/blog/cgo) dans des [Fibres](https://www.php.net/manual/fr/language.fibers.php) est connu pour provoquer des plantages.
|
||||
|
||||
Ce problème est [en cours de correction par le projet Go](https://github.com/golang/go/issues/62130).
|
||||
|
||||
En attendant, une solution consiste à ne pas utiliser de mots clefs (comme `echo`) et de fonctions (comme `header()`) qui délèguent à Go depuis l'intérieur de fibres.
|
||||
|
||||
Ce code risque de planter car il utilise `echo` dans une fibre :
|
||||
|
||||
```php
|
||||
$fiber = new Fiber(function() {
|
||||
echo 'Dans la fibre'.PHP_EOL;
|
||||
echo 'Toujours dedans'.PHP_EOL;
|
||||
});
|
||||
$fiber->start();
|
||||
```
|
||||
|
||||
A la place, retournez la valeur de la Fibre et utilisez-la à l'extérieur :
|
||||
|
||||
```php
|
||||
$fiber = new Fiber(function() {
|
||||
Fiber::suspend('Dans la fibre'.PHP_EOL));
|
||||
Fiber::suspend('Toujours dedans'.PHP_EOL));
|
||||
});
|
||||
echo $fiber->start();
|
||||
echo $fiber->resume();
|
||||
$fiber->resume();
|
||||
```
|
||||
|
||||
## Extensions PHP non prises en charge
|
||||
|
||||
Les extensions suivantes sont connues pour ne pas être compatibles avec FrankenPHP :
|
||||
|
||||
@@ -1,35 +1,5 @@
|
||||
# Known Issues
|
||||
|
||||
## Fibers
|
||||
|
||||
Calling PHP functions and language constructs that themselves call [cgo](https://go.dev/blog/cgo) in [Fibers](https://www.php.net/manual/en/language.fibers.php) is known to cause crashes.
|
||||
|
||||
This issue [is being worked on by the Go project](https://github.com/golang/go/issues/62130).
|
||||
|
||||
In the meantime, one solution is not to use constructs (like `echo`) and functions (like `header()`) that delegate to Go from inside Fibers.
|
||||
|
||||
This code will likely crash because it uses `echo` in the Fiber:
|
||||
|
||||
```php
|
||||
$fiber = new Fiber(function() {
|
||||
echo 'In the Fiber'.PHP_EOL;
|
||||
echo 'Still inside'.PHP_EOL;
|
||||
});
|
||||
$fiber->start();
|
||||
```
|
||||
|
||||
Instead, return the value from the Fiber and use it outside:
|
||||
|
||||
```php
|
||||
$fiber = new Fiber(function() {
|
||||
Fiber::suspend('In the Fiber'.PHP_EOL));
|
||||
Fiber::suspend('Still inside'.PHP_EOL));
|
||||
});
|
||||
echo $fiber->start();
|
||||
echo $fiber->resume();
|
||||
$fiber->resume();
|
||||
```
|
||||
|
||||
## Unsupported PHP Extensions
|
||||
|
||||
The following extensions are known not to be compatible with FrankenPHP:
|
||||
|
||||
@@ -1,35 +1,5 @@
|
||||
# Bilinen Sorunlar
|
||||
|
||||
## Fibers
|
||||
|
||||
[Fibers](https://www.php.net/manual/en/language.fibers.php) içinde [cgo](https://go.dev/blog/cgo) çağrısı yapan PHP fonksiyonlarının ve dil yapılarının çağrılmasının çökmelere neden olduğu bilinmektedir.
|
||||
|
||||
Bu sorun [Go projesi tarafından üzerinde çalışılmaktadır](https://github.com/golang/go/issues/62130).
|
||||
|
||||
Bu arada, bir çözüm Fibers içinden Go'ya temsilci atayan yapıları (`echo` gibi) ve fonksiyonları (`header()` gibi) kullanmamaktır.
|
||||
|
||||
Bu kod, Fiber içinde `echo` kullandığı için büyük olasılıkla çökecektir:
|
||||
|
||||
```php
|
||||
$fiber = new Fiber(function() {
|
||||
echo 'In the Fiber'.PHP_EOL;
|
||||
echo 'Still inside'.PHP_EOL;
|
||||
});
|
||||
$fiber->start();
|
||||
```
|
||||
|
||||
Bunun yerine, değeri Fiber'den döndürün ve dışarıda kullanın:
|
||||
|
||||
```php
|
||||
$fiber = new Fiber(function() {
|
||||
Fiber::suspend('In the Fiber'.PHP_EOL));
|
||||
Fiber::suspend('Still inside'.PHP_EOL));
|
||||
});
|
||||
echo $fiber->start();
|
||||
echo $fiber->resume();
|
||||
$fiber->resume();
|
||||
```
|
||||
|
||||
## Desteklenmeyen PHP Eklentileri
|
||||
|
||||
Aşağıdaki eklentilerin FrankenPHP ile uyumlu olmadığı bilinmektedir:
|
||||
|
||||
Reference in New Issue
Block a user