| Methods |
public
static
|
windowsPeclUrl(string $extension): string|null
WINDOWS ONLY - Gets an extensions zip url from pecl.php.net.
WINDOWS ONLY - Gets an extensions zip url from pecl.php.net.
Parameters
| $extension |
The name of the extension on pecl.
|
Returns
The url on success or null on failure.
|
#
|
public
static
|
windowsInstallPeclExtension(string $extension, string|null $dest_dir = null): boolean
WINDOWS ONLY - Downloads and unzips a pecl.php.net extension.
WINDOWS ONLY - Downloads and unzips a pecl.php.net extension.
Parameters
| $extension |
the pecl extension name.
|
| $dest_dir |
The directory to unzip the extension dll to, if null the current php.ini extension_dir is used.
|
Returns
Weather the extension was downloaded and unzipped successfully.
|
#
|
public
static
|
linuxEnsurePhpRepo(): boolean
UBUNTU/LINUX ONLY - Ensures the ondrej/php apt repository is enabled.
UBUNTU/LINUX ONLY - Ensures the ondrej/php apt repository is enabled.
Returns
Weather the repository is enabled.
|
#
|
public
static
|
ensure(string $extension): boolean
Checks weather the extension is loaded, if the extension is not loaded it will try to enable it so it is available…
Checks weather the extension is loaded, if the extension is not loaded it will try to enable it so it is available after a restart of PHP-CLI.
Parameters
| $extension |
The extension name.
|
Returns
Weather the extension is enabled.
|
#
|
public
static
|
extensionInfo(): array
Returns extension info, contains a list of builtin extensions and bundled extensions and install names for extensions…
Returns extension info, contains a list of builtin extensions and bundled extensions and install names for extensions where their install name is different to the extension name reported.
Access the lists like this: $extensionInfo['builtin'][PHP_OS_FAMILY] or $extensionInfo['bundled'][PHP_OS_FAMILY] or $extensionInfo['installnames'][PHP_OS_FAMILY].
The installnames is not a list, it is an array where the keys are the wanted extension name and the values are the extension to install that gets the original name.
Only contains info for Windows (8.5 ts zip) and Linux (Ubuntu 24.04.4 LTS on php8.5 from ondrej/php), last updated on 2026-05-27.
Returns
The array of information about extensions.
|
#
|
public
static
|
buildInfo(): array
Gets the build info for php, thread safety and vs version.
Gets the build info for php, thread safety and vs version.
Returns
An array with build info, $buildInfo['ts'] will be "nts" or "ts" and $buildInfo['vs'] will be something like "vs17".
|
#
|
public
static
|
areLoaded(array $extensions): boolean
Checks weather some extensions are loaded.
Checks weather some extensions are loaded.
Parameters
| $extensions |
A list of extension names.
|
Returns
Weather all the extensions are loaded.
|
#
|
public
static
|
phpVersion(): string
Returns the php major and minor version with a dot seperating them.
Returns the php major and minor version with a dot seperating them.
Returns
returns PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION.
|
#
|
public
static
|
setEnabled(string $extension, boolean $enabled = true, boolean $allowDownload = true): boolean
Enables or disables an extension, uses phpenmod and phpdismod on ubuntu or edits the php.ini file on windows.
Enables or disables an extension, uses phpenmod and phpdismod on ubuntu or edits the php.ini file on windows.
Parameters
| $extension |
The extension name.
|
| $enabled |
Weather to enable or disable the extension.
|
| $allowDownload |
Weather to allow downloading if enableing and not already installed.
|
Returns
Weather the operation was successful.
|
#
|
public
static
|
install(string $extension): boolean
Installs an extension using platform specific methods.
Installs an extension using platform specific methods.
Parameters
| $extension |
The name of the extension.
|
Returns
Weather the extension is now installed.
|
#
|
public
static
|
installed(string $extension): boolean
Checks weather an extension is in stalled.
Checks weather an extension is in stalled.
Parameters
| $extension |
The name of the extension.
|
Returns
|
#
|