efabrica / php-extensions-finder
Finds PHP extension required by code, can be used in CI
Installs: 4 978
Dependents: 0
Suggesters: 0
Security: 0
Stars: 5
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >= 7.1.0
- ext-json: *
- nikic/php-parser: ^4.1
- symfony/console: ^4.2 | ^5.0 | ^6.0
- symfony/finder: ^4.2 | ^5.0 | ^6.0
This package is auto-updated.
Last update: 2024-12-07 19:39:18 UTC
README
This library helps to find PHP extension required by your code, it can be used in CI tools.
Installation
PHP extension finder requires PHP 7.1.0 or newer. You can install it via Composer. This project is not meant to be run as a dependency, so install it as project:
mkdir -p ~/tests/php-extensions-finder
composer require efabrica/php-extensions-finder
or globally:
composer global require efabrica/php-extensions-finder
Usage
~/tests/php-extensions-finder/vendor/bin/php-extensions-finder check [--composer COMPOSER] [--] <dirs>...
or
php-extensions-finder check [--composer COMPOSER] [--] <dirs>...
if it is installed globally
For more information, run with option --help
The result looks like:
Please, add these lines to your composer.json:
==============================================
{
"require": {
"ext-json": "*"
}
}
With option -vvv
output will be extended with missing extensions usage:
Missing extensions usage:
=========================
ext-json
--------
src/Command/MyCommand.php:35 json_decode
src/Command/MyCommand.php:70 json_encode
src/Command/MyCommand.php:70 JSON_PRETTY_PRINT
Please, add these lines to your composer.json:
==============================================
{
"require": {
"ext-json": "*"
}
}
Return code is count of missing extensions, so you can use it in CI tools.