#php #extension #version #bindings #header #module #autogenerated

php-all-sys

Autogenerated Rust bindingings for PHP extension development for still used PHP versions

1 unstable release

0.0.1 Feb 24, 2021

#31 in #autogenerated

Apache-2.0 OR BSD-3-Clause

7.5MB
234K SLoC

Rust 184K SLoC // 0.0% comments M4 26K SLoC // 0.1% comments PHP 23K SLoC // 0.1% comments AWK 490 SLoC // 0.2% comments C 184 SLoC // 0.6% comments

*All PHP versions -sys crate

This crate is meant to facilitate creation of custom PHP extensions in Rust. It provides C bindings for all supported PHP versions.

This crate went through a few iterations, for now its a single crate containing all PHP versions as separate modules - this could change in the future.

In the beginning it also was generating Rust bindings on demand. But currently bindings are meant to be pregenerated - to test if the same crate works on OSX and Windows - without having to vendor OSX and Windows PHP headers.

Its possible we'll need to vendor OSX and Windows PHP includes to fully support these platforms.

Support

PHP Version Linux Windows OSX ZTS Linux ZTS Windows
PHP 5.4 Yes
PHP 5.5
PHP 5.6 Yes Yes
PHP 7.0 Yes
PHP 7.1 Yes
PHP 7.2 Yes
PHP 7.3 Yes
PHP 7.4 Yes
PHP 8.0 Yes

Generating bindings

private crate sys-build can be installed and used to generate binding files

cargo install --path sys-build
cargo php-sys-build # to generate files, should be run from Crates root dir
cargo fmt # to format generated files before commiting 

No runtime deps