Compare commits
2 Commits
dc91a39b4c
...
cece9d0d02
Author | SHA1 | Date |
---|---|---|
Florian Brinker | cece9d0d02 | |
Florian Brinker | 8d452cf62b |
50
README.md
50
README.md
|
@ -1,2 +1,52 @@
|
|||
# php-extension-check
|
||||
Check your PHP project's PHP extension requirements against all loaded PHP extensions.
|
||||
|
||||
Requires a **PHP version** of **7.2** or above.
|
||||
|
||||
The idea behind this project is to have an idea of your project's requirements for a minimal server installation.
|
||||
|
||||
Another use case can be cleaning up old legacy projects using the same server configuration/installation for decades after doing some refactorings or upgrades, esp. when moving those projects into Docker images.
|
||||
|
||||
## Installation
|
||||
*... todo, when any releases are ready*
|
||||
|
||||
## Usage
|
||||
To check your code, simply run the `extension-check.phar`.
|
||||
|
||||
The tool automatically executes the checks for the current directory (`./`).
|
||||
|
||||
### Important
|
||||
Please note that your command line and web server PHP configurations (php.ini files) may load different PHP extensions!
|
||||
|
||||
To use a specific `php.ini` file, run the tool like this:
|
||||
```php
|
||||
php -c path/to/your/webserver/php.ini ./extension-check.phar
|
||||
```
|
||||
|
||||
### Checking a specific Directory
|
||||
If you want to check a specific directory, you can specify it as an argument:
|
||||
```php
|
||||
./extension-check.phar ./src
|
||||
```
|
||||
Note: You should include your vendor files, if any, for valid results.
|
||||
|
||||
### Exclude Extensions
|
||||
If you want to exclude some PHP extensions, you can use the `--exclude` option:
|
||||
```php
|
||||
./extension-check.phar --exclude=core,standard,xdebug
|
||||
```
|
||||
or alternatively
|
||||
```php
|
||||
./extension-check.phar --exclude=core --exclude=standard --exclude=xdebug
|
||||
```
|
||||
|
||||
## Contributions
|
||||
To check the code quality, run
|
||||
```php
|
||||
composer check
|
||||
```
|
||||
|
||||
To run the test suite, execute
|
||||
```php
|
||||
composer test
|
||||
```
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"base-path": null,
|
||||
"output": "build/extension-check.phar",
|
||||
"chmod": "0700"
|
||||
}
|
|
@ -43,5 +43,19 @@
|
|||
"config": {
|
||||
"preferred-install": "dist",
|
||||
"sort-packages": true
|
||||
},
|
||||
"scripts": {
|
||||
"check": [
|
||||
"./vendor/bin/phpcbf",
|
||||
"./vendor/bin/phpcs",
|
||||
"./vendor/bin/phpstan analyse"
|
||||
],
|
||||
"test" : [
|
||||
"./vendor/bin/phpunit tests"
|
||||
]
|
||||
},
|
||||
"scripts-descriptions": {
|
||||
"check": "Check the sources for problems and style violations",
|
||||
"test": "Run all tests"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue