Allowed Bindings
The extension limits the bindings that are generated by bindgen
to a subset of the original bindings.
Those bindings are defined in the allowed_bindings.rs
file.
Should you need to add more bindings, you can do so by defining them as a comma-separated list in the EXT_PHP_RS_ALLOWED_BINDINGS
environment variable.
This can be configured in your .cargo/config.toml
file:
[env]
EXT_PHP_RS_ALLOWED_BINDINGS = "php_foo,php_bar"
Your bindings should now appear in the ext_php_rs::ffi
module.
Be aware, that bindings that do not exist in the PHP version you are targeting will not be available.
Some bindings may also change between PHP versions, so make sure to test your extension with all PHP versions you are targeting.
Contributing
If you think that a binding should be added to the allowed bindings, please open an issue or a pull request on the GitHub repository so that everyone can benefit from it.