新的 PHP SAPI 在安全 Rust 中
我最近发布了初始版本的 ripht-php-sapi RC。<p>这是一个安全的 Rust 绑定,用于 PHP 的嵌入式 SAPI。它允许你在 Rust 中执行 PHP 脚本,而无需接触不安全的代码。<p>GitHub:
https://github.com/jhavenz/ripht-php-sapi<p>Crate:
https://crates.io/crates/ripht-php-sapi<p>我计划构建一些基于 Rust 的高级 PHP 工具,但需要一个干净的起点。我也没有看到现有的 Rust SAPI 实现,因此大约三个月后,这个项目就诞生了。这段时间里有相当一部分是用于研究的。令人惊讶的是,外面关于这方面的教育材料是如此稀缺和陈旧。因此,能从 20 多年的经过实践检验的源代码中学习真是个好事!感谢 Nginx unit、php/php-fpm、Apache 和 Frankenphp。能够比较和对比不同的实现非常有帮助。如果有人对 PHP SAPI 内部和 Rust FFI 的内容感兴趣,可以查看这个链接了解更多信息: https://www.patreon.com/posts/gauging-php-sapi-146489023<p>我欢迎反馈。
查看原文
I recently published the initial ripht-php-sapi RC.<p>It’s safe Rust bindings for PHP's embed SAPI. Lets you execute PHP scripts from Rust without touching unsafe code.<p>GitHub:
https://github.com/jhavenz/ripht-php-sapi<p>Crate:
https://crates.io/crates/ripht-php-sapi<p>I'd plan to build some higher level Rust-based PHP tooling but need the proverbial clean slate. I also didn’t see any existing SAPI implementations for Rust, so ~3 months later, here it is. A good chunk of that was research. It’s surprising how scarce and archaic the educational material is out there. So, good thing there was 20+ years of battle-tested source code to learn from! Thank you to Nginx unit, php/php-fpm, apache, and Frankenphp. Being able to compare and contrast implementations was extremely helpful. Also gauging interest in content about PHP SAPI internals and Rust FFI if anyone's curious about that rabbit hole: https://www.patreon.com/posts/gauging-php-sapi-146489023<p>I’m open to feedback