Inside the environment wrapper, you declare the system requirements your
package needs to run.
Note
To illustrate metadata entries, we use the Fusion - PHP Package Manager package.
PHP Version
The required version entry specifies a logical expression that the current PHP
version must satisfy. For example:
{
"environment": {
"php": {
"version": "8.1.0"
}
}
}
In this example, version 8.1.0 without a sign is shorthand for
>=8.1.0 && <9.0.0, meaning that the PHP version must be at least 8.1.0 but
lower than 9.0.0.
Note
Since a semantic version by itself already implies a range, signless semantic versions are used as shorthand range expressions for all versions without breaking changes.
In addition to the core semantic version (major.minor.patch), the expression may include the following parts:
- The
&&and||operators - The condition brackets
() - One of the signs as prefix before the version core:
!=not equal==equal=greater than or equal<=less than or equal>greater than<less than
Note
Fusion considers only the major, minor, and patch parts of semantic versions for PHP.
PHP Modules
The optional modules entry lists the PHP modules required by your package.
For example, Fusion requires the curl module:
{
"environment": {
"php": {
"modules": [
"curl"
]
}
}
}
Note
Module names must exactly match (case-sensitive) those returned by the
function get_loaded_extensions.