v5.0.0 release #227
codemasher
started this conversation in
Feedback
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi! It's been a while since the last major version - has it already been over three years and seven million downloads??? Time flies...
v5 was supposed to be released earlier this year already, but various health issues kept me from working on it and I kept y'all waiting and using
dev-main
and thev5-beta
instead - but hey, the wait is over now!The new version comes with countless internal changes, mostly to incooperate the ZXing QR Code reader and open the possibility for other types of barcodes, such as micro QR.
A lot of things have been deprecated and moved in order to clean up for v6 which is intended to support PHP 8.2+ (or maybe 8.3+ even). See the attached discussion thread for a full list of changes and deprecations.
IMPORTANT: v5 will be branched out and the
main
branch will become (or rather remain) the active development branch towards v6. If you have used the composer versiondev-main
without a commit hash in the past, please make sure to update the requirement ASAP. You have been warned.Also, a big thank you to everyone who submitted issue reports and opened discussions and helped to improve this library!
New Features
Structured append mode(not yet...)Changes
ext-gd
orext-imagick
) required anymore!src
into an<img>
tag. This can be disabled by settingQROptions::$outputBase64
tofalse
.QROptions::$imageTransparent
has been set tofalse
due to various issues and misconceptions with transparency in GD and ImageMagick, therefore: use at your own risk.QRMatrix::M_*
constants and therefore the keys of theQROptions::$moduleValues
array have changed.QRMatrix::M_*_DARK
constants have been introduced for convenience. The module values are now a proper bitmask, the dark value is now calculated(QRMatrix::M_* | QRMatrix::IS_DARK)
instead of(QRMatrix::M_* << 8)
.QRMarkup
has been changed toabstract
, inheritors are nowQRMarkupHTML
andQRMarkupSVG
(QRMarkupXML
anyone?).fill-opacity
attribute (and its respective settingQROptions::$svgOpacity
) has been removed fromQRMarkupSVG::path()
as it can be set by CSS.QROptions::$markupDark
andQROptions::$markupLight
settings have been removed - they can be set via overridingQRMarkup::getDefaultModuleValue()
.QROptions::$textDark
andQROptions::$textLight
settings have been removed - they can be set via overridingQRString::getDefaultModuleValue()
.QROutputInterface::moduleValueIsValid()
is nowpublic static
, so that input values can be checked before invoking the options, e.g.QRMarkupSVG::moduleValueIsValid('#aabbcc')
. Please note that in case of HTML and SVG it will only check for the basic syntax, it will not validate or sanitize the values.QROptions::$jpegQuality
andQROptions::$pngCompression
have been deprecated in favor of the more genericQROptions::$quality
.QROptions::$svgUseFillAttributes
has been added to togglefill
attributes on the SVG<path>
elements inQRMarkupSVG::path()
(this was previously done via settingQROptions::$markupDark
andQROptions::$markupLight
to an empty value).API
The full API documentation can be found under https://chillerlan.github.io/php-qrcode/
class names are relative from the namespace
chillerlan\QRCode
, only public facing items are listedChanged/Moved
without deprecation
\QRCode::getMatrix(string $data)
\QRCode::getMatrix()
\QROptions::$moduleValues
(array|null
)\QROptions::$moduleValues
(array
)\Helpers\BitBuffer::class
\Common\BitBuffer::class
\Data\QRMatrix::__construct(int $version, int $eclevel)
\Data\QRMatrix::__construct(Version $version, EccLevel $eccLevel)
\Data\QRMatrix::init(int $maskPattern, bool $test = null)
\Data\QRMatrix::initFunctionalPatterns()
\Data\QRMatrix::setFormatInfo(int $maskPattern, bool $test = null)
\Data\QRMatrix::setFormatInfo(MaskPattern $maskPattern = null)
\Data\QRMatrix::setQuietZone(int $size = null)
\Data\QRMatrix::setQuietZone(int $quietZoneSize)
\Data\QRMatrix::setVersionNumber(bool $test = null)
\Data\QRMatrix::setVersionNumber()
\Data\QRMatrix::mapData(array $data, int $maskPattern)
\Data\QRMatrix::writeCodewords(BitBuffer $bitBuffer)
deprecated
The following items are deprecated as of v5 and will be removed in v6.
\QRCode::VERSION_AUTO
\Common\Version::AUTO
\QRCode::MASK_PATTERN_AUTO
\Common\MaskPattern::AUTO
\QRCode::ECC_L
\Common\EccLevel::L
\QRCode::ECC_M
\Common\EccLevel::M
\QRCode::ECC_Q
\Common\EccLevel::Q
\QRCode::ECC_H
\Common\EccLevel::H
\QRCode::OUTPUT_MARKUP_HTML
\Output\QROutputInterface::MARKUP_HTML
(also deprecated)\QRCode::OUTPUT_MARKUP_SVG
\Output\QROutputInterface::MARKUP_SVG
(also deprecated)\QRCode::OUTPUT_IMAGE_PNG
\Output\QROutputInterface::GDIMAGE_PNG
(also deprecated)\QRCode::OUTPUT_IMAGE_JPG
\Output\QROutputInterface::GDIMAGE_JPG
(also deprecated)\QRCode::OUTPUT_IMAGE_GIF
\Output\QROutputInterface::GDIMAGE_GIF
(also deprecated)\QRCode::OUTPUT_STRING_JSON
\Output\QROutputInterface::STRING_JSON
(also deprecated)\QRCode::OUTPUT_STRING_TEXT
\Output\QROutputInterface::STRING_TEXT
(also deprecated)\QRCode::OUTPUT_IMAGICK
\Output\QROutputInterface::IMAGICK
(also deprecated)\QRCode::OUTPUT_FPDF
\Output\QROutputInterface::FPDF
(also deprecated)\QRCode::OUTPUT_EPS
\Output\QROutputInterface::EPS
(also deprecated)\QRCode::OUTPUT_CUSTOM
\Output\QROutputInterface::CUSTOM
(also deprecated)\QRCode::OUTPUT_MODES
\Output\QROutputInterface::MODES
(also deprecated)\QRCode::getMatrix()
\QRCode::getQRMatrix()
\QRCode::isNumber()
\Data\Number::validateString()
\QRCode::isAlphaNum()
\Data\AlphaNum::validateString()
\QRCode::isKanji()
\Data\Kanji::validateString()
\QRCode::isByte()
\Data\Byte::validateString()
\QROptions::$imageBase64
\QROptions::$outputBase64
\QROptions::$imageTransparencyBG
(array
)\QROptions::$transparencyColor
(mixed
)\QROptions::$imagickBG
(string
)\QROptions::$bgColor
(mixed
)\QROptions::$outputType
\QROptions::$outputInterface
\QROptions::$pngCompression
\QROptions::$quality
\QROptions::$jpegQuality
\QROptions::$quality
\Data\QRMatrix::eccLevel()
\Data\QRMatrix::getEccLevel()
\Data\QRMatrix::maskPattern()
\Data\QRMatrix::getMaskPattern()
\Data\QRMatrix::matrix(bool $boolean = null)
\Data\QRMatrix::getMatrix(bool $boolean = null)
\Data\QRMatrix::size()
\Data\QRMatrix::getSize()
\Data\QRMatrix::version()
\Data\QRMatrix::getVersion()
\Output\QRImage::class
\Output\QRGdImage::class
\Output\QRString::class
\Output\QRStringText::class
and\Output\QRStringJSON::class
Added
\QRCode::addSegment(QRDataModeInterface $segment)
\QRCode::addNumericSegment(string $data)
\QRCode::addAlphaNumSegment(string $data)
\QRCode::addByteSegment(string $data)
\QRCode::addHanziSegment(string $data)
\QRCode::addKanjiSegment(string $data)
\QRCode::addEciDesignator(int $encoding)
\QRCode::addEciSegment(int $encoding, string $data)
\QRCode::clearSegments()
\QRCode::readFromBlob(string $blob)
\QRCode::readFromFile(string $path)
\QRCode::readFromSource(LuminanceSourceInterface $source)
\QRCode::renderMatrix(QRMatrix $matrix, string $file = null)
\QRCode::setOptions(SettingsContainerInterface $options)
\QROptions::$addLogoSpace
\QROptions::$bgColor
\QROptions::$circleRadius
\QROptions::$connectPaths
\QROptions::$drawCircularModules
\QROptions::$drawLightModules
\QROptions::$excludeFromConnect
\QROptions::$gdImageUseUpscale
\QROptions::$invertMatrix
\QROptions::$jsonAsBooleans
\QROptions::$jsonFlags
\QROptions::$keepAsSquare
\QROptions::$logoSpaceWidth
\QROptions::$logoSpaceHeight
\QROptions::$logoSpaceStartX
\QROptions::$logoSpaceStartY
\QROptions::$readerUseImagickIfAvailable
\QROptions::$readerGrayscale
\QROptions::$readerInvertColors
\QROptions::$readerIncreaseContrast
\QROptions::$svgPreserveAspectRatio
\QROptions::$svgUseFillAttributes
\QROptions::$textLineStart
\Common\EccLevel::class
\Common\ECICharset::class
\Common\MaskPattern::class
\Common\Mode::class
\Common\Version::class
\Data\QRMatrix::IS_DARK
\Data\QRMatrix::M_DARKMODULE_LIGHT
\Data\QRMatrix::M_DATA_DARK
\Data\QRMatrix::M_FINDER_DARK
\Data\QRMatrix::M_FINDER_DOT_LIGHT
\Data\QRMatrix::M_ALIGNMENT_DARK
\Data\QRMatrix::M_TIMING_DARK
\Data\QRMatrix::M_FORMAT_DARK
\Data\QRMatrix::M_VERSION_DARK
\Data\QRMatrix::M_QUIETZONE_DARK
\Data\QRMatrix::M_LOGO_DARK
\Data\QRMatrix::M_SEPARATOR_DARK
\Data\QRMatrix::checkType(int $x, int $y, int $M_TYPE)
\Data\QRMatrix::checkTypeIn(int $x, int $y, array $M_TYPES)
\Data\QRMatrix::checkNeighbours(int $x, int $y, int $M_TYPE_VALUE = null)
\Data\QRMatrix::flip()
\Data\QRMatrix::invert()
\Data\QRMatrix::isDark(int $M_TYPE)
\Data\QRMatrix::mask()
\Data\QRMatrix::rotate90()
\Data\QRMatrix::setArea(int $startX, int $startY, int $width, int $height, bool $value, int $M_TYPE)
\Decoder\Decoder::class
\Decoder\DecoderResult::class
\Decoder\GDLuminanceSource::class
\Decoder\IMagickLuminanceSource::class
\Decoder\LuminanceSourceInterface::class
\Data\Hanzi::class
\Data\ECI::class
\Data\QRData::class
\Data\QRDataModeInterface::class
\Data\QRDataModeAbstract::class
\Output\QROutputInterface::moduleValueIsValid($value)
\Output\QREps::class
\Output\QRMarkupHTML::class
\Output\QRMarkupSVG::class
Removed
\QRCode::initDataInterface()
\QROptions::$dataModeOverride
\QROptions::$svgOpacity
QRMarkupSVG::path()
instead\QROptions::$svgViewBoxSize
QRMarkupSVG::getViewBox()
instead (#222)\QROptions::$markupDark
QRMarkup::getDefaultModuleValue()
instead\QROptions::$markupLight
QRMarkup::getDefaultModuleValue()
instead\QROptions::$textDark
QRString::getDefaultModuleValue()
instead\QROptions::$textLight
QRString::getDefaultModuleValue()
instead\Data\QRDataAbstract::class
\Data\QRDataInterface::class
\Data\QRMatrix::M_TEST
This discussion was created from the release 5.0.0.
Beta Was this translation helpful? Give feedback.
All reactions