peachpiecompiler / peachpie

PeachPie - the PHP compiler and runtime for .NET and .NET Core
https://www.peachpie.io
Apache License 2.0
2.31k stars 202 forks source link

is there any plan to implement pcntl and posix extensions of php #1006

Closed avriltank closed 2 years ago

avriltank commented 2 years ago

Hello, do peachpie have any plans to implement pctl and POSIX extensions? I originally had an amphp project based on PHP libevent extension. I basically migrated all the code to peachpie, except pctl and POSIX extension If I use "mono. POSIX", I find that I can quickly implement these two extensions in peachpie. I haven't tried to extend PHP with Csharp. If possible, I'm willing to try to implement it, but I haven't learned CSharp for a long time, and the code quality should be very poor!

jakubmisek commented 2 years ago

Hi,

PeachPie already implements some PHP functions using Mono.Posix. Pctl or other Posix functions were not needed yet; do you have a list of what is needed?

avriltank commented 2 years ago

I found that Mono.Posix has disabled fork. I guess his author should consider that many APIs are thread related, so we directly disable the fork function of libc. However, in the current ecosystem of PHP, there are many multi process + fiber schemes, and this architecture model is also more convenient for daemon + multiple worker processes

jakubmisek commented 2 years ago

But what specifically requires "Mono.Posix" to be used. .NET has intense threading API's included so we can use that.

Anyways; do you have a list of PHP extensions/functions/classes you miss in PeachPie?

avriltank commented 2 years ago

All functions of pcntl and all functions of posix,we can use llibuv instead of libevent.

jakubmisek commented 2 years ago

thanks! we don't have plans for that, but I can create a branch here on GitHub, create a few empty function stubs, and help with the implementation.

avriltank commented 2 years ago

Very nice!thanks for your reply