-
-
Notifications
You must be signed in to change notification settings - Fork 7
Wiki/Requirements: improve information about required PHP extensions #97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
e86ba1c
Wiki/Requirements: add links to the docs for each PHP extension
jrfnl 1db2835
Wiki/Requirements: add information on additional PHP extensions
jrfnl 159d41b
Wiki/Requirements: add more info about recommendations and links to o…
jrfnl c995eac
Wiki/Requirements: improve readability
jrfnl 81680a0
Wiki/Requirements: improve information about use of iconv in reports
jrfnl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,19 +1,41 @@ | ||
| PHP_CodeSniffer 4.x requires PHP 7.2.0 or greater. | ||
| PHP_CodeSniffer 4.x requires **PHP 7.2.0 or greater**. | ||
| _Prior to PHP_CodeSniffer 4.0.0, the minimum PHP requirement was 5.4.0._ | ||
|
|
||
| Additionally, PHP_CodeSniffer requires the following PHP extensions to be enabled: | ||
| - Tokenizer: used by the core tokenizer to process PHP files | ||
| - SimpleXML: used to process ruleset XML files | ||
| - XMLWriter: used to create some report formats | ||
| - **[Tokenizer][tokenizer]**: used by the core tokenizer to process PHP files | ||
| - **[SimpleXML][simplexml]**: used to process ruleset XML files | ||
| - **[XMLWriter][xmlwriter]**: used to create some report formats | ||
| - **[libxml]**: required by the SimpleXML and XMLWriter extensions | ||
|
|
||
| The following PHP extensions are not required, but are strongly recommended: | ||
| - iconv: used for accurate character length calculation in files containing multibyte characters. Without this extension, some sniffs, like `Generic.Files.LineLength`, may report incorrect results for lines containing non-ASCII characters, as PHP_CodeSniffer will fall back to byte-based length calculations. | ||
| - PCNTL: required for parallel processing via the `--parallel` CLI option. Without this extension, PHP_CodeSniffer will not be able to check multiple files simultaneously. | ||
| The following PHP extensions are not required, but are **_strongly recommended_**: | ||
| - **[DOM][dom]**: used for displaying the sniff documentation via the `--generator=...` option. | ||
| - **[iconv]**: used for accurate character length calculation in files containing multibyte characters. | ||
| Without this extension, some sniffs, like `Generic.Files.LineLength`, may report incorrect results for lines containing non-ASCII characters, as PHP_CodeSniffer will fall back to byte-based length calculations. | ||
| Additionally, the following reports will not work without this extension if the project `encoding` is not UTF-8: [Checkstyle][wiki-report-checkstyle], [JUnit][wiki-report-junit] and [XML][wiki-report-xml]. | ||
| - **[json]**: required for the cache functionality, as well as for the [JSON report][wiki-report-json] output. | ||
| - **[PCNTL][pcntl]**: required for parallel processing via the `--parallel` CLI option. | ||
| Without this extension, PHP_CodeSniffer will not be able to check multiple files simultaneously. | ||
|
|
||
| Individual sniffs may have additional requirements such as external applications and scripts. See the [Configuration Options](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Configuration-Options) manual page for a list of these requirements. | ||
| Individual sniffs may have additional requirements such as external applications and scripts. See the [Configuration Options][wiki-config] manual page for a list of these requirements. | ||
|
|
||
| > [!WARNING] | ||
| > The gRPC PHP extension is known to cause PHP_CodeSniffer to hang when running with parallel processing enabled. If the gRPC extension is loaded, either do not use the `--parallel` CLI option or configure the extension's ini settings as follows: | ||
| > The **[gRPC PHP extension][grpc]** is known to cause PHP_CodeSniffer to hang when running with parallel processing enabled. If the gRPC extension is loaded, either do not use the `--parallel` CLI option or configure the extension's ini settings as follows: | ||
| > ```text | ||
| > phpcs -d grpc.enable_fork_support=1 -d grpc.poll_strategy=epoll1 [other options] <file|directory> | ||
| > ``` | ||
|
|
||
| [dom]: https://www.php.net/book.dom | ||
| [grpc]: https://grpc.io/docs/languages/php/ | ||
| [iconv]: https://www.php.net/book.iconv | ||
| [json]: https://www.php.net/book.json | ||
| [libxml]: https://www.php.net/book.libxml | ||
| [pcntl]: https://www.php.net/book.pcntl | ||
| [simplexml]: https://www.php.net/book.simplexml | ||
| [tokenizer]: https://www.php.net/book.tokenizer | ||
| [xmlwriter]: https://www.php.net/book.xmlwriter | ||
|
|
||
| [wiki-config]: https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Configuration-Options | ||
| [wiki-report-checkstyle]: https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Reporting#printing-a-checkstyle-report | ||
| [wiki-report-json]: https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Reporting#printing-a-json-report | ||
| [wiki-report-junit]: https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Reporting#printing-a-junit-report | ||
| [wiki-report-xml]: https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Reporting#printing-an-xml-report | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.