mirror of
https://github.com/chillerlan/php-qrcode.git
synced 2026-08-17 08:52:34 +00:00
📖
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# chillerlan/php-qrcode
|
||||
|
||||
A PHP QR Code generator based on the [implementation by Kazuhiko Arase](https://github.com/kazuhikoarase/qrcode-generator), namespaced, cleaned up, improved and other stuff. <br>
|
||||
A PHP QR Code generator based on the [implementation by Kazuhiko Arase](https://github.com/kazuhikoarase/qrcode-generator), namespaced, cleaned up, improved and other stuff.
|
||||
It also features a QR Code reader based on a [PHP port](https://github.com/khanamiryan/php-qrcode-detector-decoder) of the [ZXing library](https://github.com/zxing/zxing).
|
||||
|
||||
**Attention:** there is now also a javascript port on NPM: [@chillerlan/qrcode](https://www.npmjs.com/package/@chillerlan/qrcode).
|
||||
@@ -74,7 +74,6 @@ For the QR Code reader, either `ext-gd` or `ext-imagick` is required!
|
||||
- Benchmark results can be found in the [`benchmark` branch](https://github.com/chillerlan/php-qrcode/tree/benchmark/markdown)
|
||||
|
||||
**Important: Please use the examples from the branch that matches your installed php-qrcode version (
|
||||
[v4.x](https://github.com/chillerlan/php-qrcode/tree/v4.3.x/examples),
|
||||
[v5.x](https://github.com/chillerlan/php-qrcode/tree/v5.0.x/examples),
|
||||
[v6.x](https://github.com/chillerlan/php-qrcode/tree/v6.0.x/examples),
|
||||
[dev-main](https://github.com/chillerlan/php-qrcode/tree/main/examples)
|
||||
|
||||
@@ -48,7 +48,7 @@ alternatively you can just pass the letters L/M/Q/H (case-insensitive) to the ma
|
||||
|
||||
## maskPattern
|
||||
|
||||
Mask Pattern to use (no value in using, mostly for unit testing purposes)
|
||||
Mask Pattern to use (no value in using, mostly for unit testing purposes, will cause unreadable symbols)
|
||||
|
||||
`0 ... 7` or `MaskPattern::PATTERN_AUTO` (default)
|
||||
|
||||
@@ -84,7 +84,7 @@ The FQCN of the `QROutputInterface` to use
|
||||
|
||||
Return the image resource instead of a render if applicable.
|
||||
|
||||
- `QRGdImage`: `resource` (PHP < 8), `GdImage`
|
||||
- `QRGdImage`: `GdImage`
|
||||
- `QRImagick`: `Imagick`
|
||||
- `QRFpdf`: `FPDF`
|
||||
|
||||
@@ -432,22 +432,24 @@ Sets an optional XSLT stylesheet in the XML output
|
||||
|
||||
## readerUseImagickIfAvailable
|
||||
|
||||
Use Imagick (if available) when reading QR Codes
|
||||
Use Imagick when reading QR Codes.
|
||||
|
||||
Enables Imagick for the QR Code reader if the extension is available.
|
||||
|
||||
|
||||
## readerGrayscale
|
||||
|
||||
Grayscale the image before reading
|
||||
Grayscale the image before reading.
|
||||
|
||||
|
||||
## readerInvertColors
|
||||
|
||||
Invert the colors of the image
|
||||
Invert the colors of the image.
|
||||
|
||||
|
||||
## readerIncreaseContrast
|
||||
|
||||
Increase the contrast before reading
|
||||
Increase the contrast before reading.
|
||||
|
||||
note that applying contrast works different in GD and Imagick, so mileage may vary
|
||||
Note that applying contrast works different in GD and Imagick, so mileage may vary.
|
||||
|
||||
|
||||
@@ -82,10 +82,10 @@ The PHP built-in extensions [GdImage](https://www.php.net/manual/book.image.php)
|
||||
|
||||
| version | branch/tag | PHP | supported | required extensions | optional extensions | info |
|
||||
|---------|----------------------------------------------------------------------|------------------|-----------|---------------------|------------------------------------------------------------------------------------|---------------------------|
|
||||
| **v7** | [`dev-main`](https://github.com/chillerlan/php-qrcode/tree/main) | `^8.4` | yes | `mbstring` | `gd` or `imagick` required for reading QR Codes, `fileinfo` is used in `QRImagick` | |
|
||||
| **v6** | [`6.0.0`](https://github.com/chillerlan/php-qrcode/tree/v6.0.x) | `^8.2` | yes | `mbstring` | `gd` or `imagick` required for reading QR Codes, `fileinfo` is used in `QRImagick` | |
|
||||
| **v5** | [`5.0.5`](https://github.com/chillerlan/php-qrcode/tree/v5.0.x) | `^7.4 \|\| ^8.0` | yes | `mbstring` | `gd` or `imagick` required for reading QR Codes, `fileinfo` is used in `QRImagick` | |
|
||||
| **v4** | [`4.3.4`](https://github.com/chillerlan/php-qrcode/tree/v4.3.x) | `^7.4 \|\| ^8.0` | no | `gd`, `mbstring` | `imagick` | |
|
||||
| **v7** | [`dev-main`](https://github.com/chillerlan/php-qrcode/tree/main) | `^8.4` | - | `mbstring` | `gd` or `imagick` required for reading QR Codes, `fileinfo` is used in `QRImagick` | |
|
||||
| **v6** | [`6.x`](https://github.com/chillerlan/php-qrcode/tree/v6.0.x) | `^8.2` | yes | `mbstring` | `gd` or `imagick` required for reading QR Codes, `fileinfo` is used in `QRImagick` | |
|
||||
| **v5** | [`5.x`](https://github.com/chillerlan/php-qrcode/tree/v5.0.x) | `^7.4 \|\| ^8.0` | yes | `mbstring` | `gd` or `imagick` required for reading QR Codes, `fileinfo` is used in `QRImagick` | |
|
||||
| **v4** | [`4.4.2`](https://github.com/chillerlan/php-qrcode/tree/v4.3.x) | `^7.4 \|\| ^8.0` | no | `gd`, `mbstring` | `imagick` | |
|
||||
| **v3** | [`3.4.1`](https://github.com/chillerlan/php-qrcode/tree/v3.2.x) | `^7.2` | no | `gd`, `mbstring` | `imagick` | v3.4.1 also supports PHP8 |
|
||||
| **v2** | [`2.0.8`](https://github.com/chillerlan/php-qrcode/tree/v2.0.x) | `>=7.0.3` | no | `gd`, `mbstring` | | |
|
||||
| **v1** | [`1.0.9`](https://github.com/chillerlan/php-qrcode/tree/v2.0.x-php5) | `>=5.6` | no | `gd`, `mbstring` | | please let PHP 5 die! |
|
||||
|
||||
@@ -20,7 +20,7 @@ $content = [
|
||||
|
||||
$reflectionClass = new ReflectionClass(QROptions::class);
|
||||
|
||||
foreach($reflectionClass->getProperties(ReflectionProperty::IS_PROTECTED) as $reflectionProperty){
|
||||
foreach($reflectionClass->getProperties(ReflectionProperty::IS_PROTECTED|ReflectionProperty::IS_PUBLIC) as $reflectionProperty){
|
||||
$docblock = $reflectionProperty->getDocComment();
|
||||
|
||||
// don't document deprecated settings
|
||||
|
||||
@@ -19,8 +19,9 @@ use function extension_loaded;
|
||||
trait QRCodeReaderOptionsTrait{
|
||||
|
||||
/**
|
||||
* Use Imagick (if available) when reading QR Codes,
|
||||
* enables Imagick for the QR Code reader if the extension is available
|
||||
* Use Imagick when reading QR Codes.
|
||||
*
|
||||
* Enables Imagick for the QR Code reader if the extension is available.
|
||||
*/
|
||||
public bool $readerUseImagickIfAvailable = false {
|
||||
set{
|
||||
@@ -29,19 +30,19 @@ trait QRCodeReaderOptionsTrait{
|
||||
}
|
||||
|
||||
/**
|
||||
* Grayscale the image before reading
|
||||
* Grayscale the image before reading.
|
||||
*/
|
||||
public bool $readerGrayscale = false;
|
||||
|
||||
/**
|
||||
* Invert the colors of the image
|
||||
* Invert the colors of the image.
|
||||
*/
|
||||
public bool $readerInvertColors = false;
|
||||
|
||||
/**
|
||||
* Increase the contrast before reading
|
||||
* Increase the contrast before reading.
|
||||
*
|
||||
* note that applying contrast works different in GD and Imagick, so mileage may vary
|
||||
* Note that applying contrast works different in GD and Imagick, so mileage may vary.
|
||||
*/
|
||||
public bool $readerIncreaseContrast = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user