# PHP Module Acceptance

`valaphp-runtime-embed` must only expose generated wrappers for PHP modules that
are accepted by the package build configuration.

The default generated zval wrapper set is limited to PHP modules that Gentoo
`dev-lang/php` cannot disable through USE flags. Optional PHP modules must be
enabled explicitly through all of these layers:

1. A Gentoo USE flag named `module_<php-module>` on the runtime package.
2. A matching Meson option named `module_<php-module>`.
3. A generator argument such as `--php-module=<php-module>`.
4. Matching ebuild dependencies on `dev-lang/php:<slot>[<php-use-flag>]`.

Example: `module_tokenizer` enables `ext/tokenizer`, which provides
`token_get_all()` and `token_name()`.

The same acceptance path applies to future static/native functions. If a PHP
module is not accepted through the ebuild USE flag and Meson option, neither
zval wrappers nor static/native functions for that module should be generated
or built.

When adding a new optional module, verify both states:

- With `-Dmodule_<php-module>=false`, generated output must not contain that
  module's zval/static functions.
- With `-Dmodule_<php-module>=true`, generated output may contain those
  functions, and the ebuild must require the corresponding PHP USE flag.
