Documentation

QRCode
in package

Turns a text string into a Model 2 QR Code

Tags
see
https://github.com/kazuhikoarase/qrcode-generator/tree/master/php
see
http://www.qrcode.com/en/codes/model12.html
see
https://www.swisseduc.ch/informatik/theoretische_informatik/qr_codes/docs/qr_standard.pdf
see
https://en.wikipedia.org/wiki/QR_code
see
http://www.thonky.com/qr-code-tutorial/

Table of Contents

ECC_H  = \chillerlan\QRCode\Common\EccLevel::H
ECC_L  = \chillerlan\QRCode\Common\EccLevel::L
ECC_M  = \chillerlan\QRCode\Common\EccLevel::M
ECC_Q  = \chillerlan\QRCode\Common\EccLevel::Q
MASK_PATTERN_AUTO  = -1
OUTPUT_CUSTOM  = 'custom'
OUTPUT_FPDF  = 'fpdf'
OUTPUT_IMAGE_GIF  = 'gif'
OUTPUT_IMAGE_JPG  = 'jpg'
OUTPUT_IMAGE_PNG  = 'png'
OUTPUT_IMAGICK  = 'imagick'
OUTPUT_MARKUP_HTML  = 'html'
OUTPUT_MARKUP_SVG  = 'svg'
OUTPUT_MODES  = [self::OUTPUT_MARKUP_SVG => \chillerlan\QRCode\Output\QRMarkup::class, self::OUTPUT_MARKUP_HTML => \chillerlan\QRCode\Output\QRMarkup::class, self::OUTPUT_IMAGE_PNG => \chillerlan\QRCode\Output\QRGdImage::class, self::OUTPUT_IMAGE_GIF => \chillerlan\QRCode\Output\QRGdImage::class, self::OUTPUT_IMAGE_JPG => \chillerlan\QRCode\Output\QRGdImage::class, self::OUTPUT_STRING_JSON => \chillerlan\QRCode\Output\QRString::class, self::OUTPUT_STRING_TEXT => \chillerlan\QRCode\Output\QRString::class, self::OUTPUT_IMAGICK => \chillerlan\QRCode\Output\QRImagick::class, self::OUTPUT_FPDF => \chillerlan\QRCode\Output\QRFpdf::class]
Map of built-in output modes => modules
OUTPUT_STRING_JSON  = 'json'
OUTPUT_STRING_TEXT  = 'text'
VERSION_AUTO  = -1
$dataSegments  : array<string|int, mixed>
A collection of one or more data segments of [classname, data] to write
$options  : SettingsContainerInterface
The settings container
__construct()  : mixed
QRCode constructor.
addAlphaNumSegment()  : self
Adds an alphanumeric data segment
addByteSegment()  : self
Adds an 8-bit byte data segment
addEciDesignator()  : self
Adds a standalone ECI designator
addEciSegment()  : self
Adds an ECI data segment (including designator)
addKanjiSegment()  : self
Adds a Kanji data segment
addNumericSegment()  : self
Adds a numeric data segment
clearSegments()  : self
Clears the data segments array
getMatrix()  : QRMatrix
Returns a QRMatrix object for the given $data and current QROptions
isAlphaNum()  : bool
checks if a string qualifies as alphanumeric (convenience method)
isByte()  : bool
a dummy (convenience method)
isKanji()  : bool
checks if a string qualifies as Kanji (convenience method)
isNumber()  : bool
checks if a string qualifies as numeric (convenience method)
readFromBlob()  : DecoderResult
Reads a QR Code from the given data blob
readFromFile()  : DecoderResult
Reads a QR Code from a given file
readFromSource()  : DecoderResult
Reads a QR Code from the given luminance source
render()  : mixed
Renders a QR Code for the given $data and QROptions
addSegment()  : void
Adds a data segment
initCustomOutputInterface()  : QROutputInterface
initializes a custom output module after checking the existence of the class and if it implemnts the required interface
initOutputInterface()  : QROutputInterface
returns a fresh (built-in) QROutputInterface

Constants

ECC_H

public int ECC_H = \chillerlan\QRCode\Common\EccLevel::H
Tags
deprecated
5.0.0
see
EccLevel::H

ECC_L

public int ECC_L = \chillerlan\QRCode\Common\EccLevel::L
Tags
deprecated
5.0.0
see
EccLevel::L

ECC_M

public int ECC_M = \chillerlan\QRCode\Common\EccLevel::M
Tags
deprecated
5.0.0
see
EccLevel::M

ECC_Q

public int ECC_Q = \chillerlan\QRCode\Common\EccLevel::Q
Tags
deprecated
5.0.0
see
EccLevel::Q

MASK_PATTERN_AUTO

public int MASK_PATTERN_AUTO = -1

OUTPUT_CUSTOM

public string OUTPUT_CUSTOM = 'custom'

OUTPUT_FPDF

public string OUTPUT_FPDF = 'fpdf'

OUTPUT_IMAGE_GIF

public string OUTPUT_IMAGE_GIF = 'gif'

OUTPUT_IMAGE_JPG

public string OUTPUT_IMAGE_JPG = 'jpg'

OUTPUT_IMAGE_PNG

public string OUTPUT_IMAGE_PNG = 'png'

OUTPUT_IMAGICK

public string OUTPUT_IMAGICK = 'imagick'

OUTPUT_MARKUP_HTML

public string OUTPUT_MARKUP_HTML = 'html'

OUTPUT_MARKUP_SVG

public string OUTPUT_MARKUP_SVG = 'svg'

OUTPUT_MODES

Map of built-in output modes => modules

public array<string|int, string> OUTPUT_MODES = [self::OUTPUT_MARKUP_SVG => \chillerlan\QRCode\Output\QRMarkup::class, self::OUTPUT_MARKUP_HTML => \chillerlan\QRCode\Output\QRMarkup::class, self::OUTPUT_IMAGE_PNG => \chillerlan\QRCode\Output\QRGdImage::class, self::OUTPUT_IMAGE_GIF => \chillerlan\QRCode\Output\QRGdImage::class, self::OUTPUT_IMAGE_JPG => \chillerlan\QRCode\Output\QRGdImage::class, self::OUTPUT_STRING_JSON => \chillerlan\QRCode\Output\QRString::class, self::OUTPUT_STRING_TEXT => \chillerlan\QRCode\Output\QRString::class, self::OUTPUT_IMAGICK => \chillerlan\QRCode\Output\QRImagick::class, self::OUTPUT_FPDF => \chillerlan\QRCode\Output\QRFpdf::class]

OUTPUT_STRING_JSON

public string OUTPUT_STRING_JSON = 'json'

OUTPUT_STRING_TEXT

public string OUTPUT_STRING_TEXT = 'text'

VERSION_AUTO

public int VERSION_AUTO = -1

Properties

$dataSegments

A collection of one or more data segments of [classname, data] to write

protected array<string|int, mixed> $dataSegments = []
Tags
see
QRDataModeInterface

$options

The settings container

protected SettingsContainerInterface $options

Methods

__construct()

QRCode constructor.

public __construct([SettingsContainerInterface $options = null ]) : mixed

Sets the options instance

Parameters
$options : SettingsContainerInterface = null
Return values
mixed

addAlphaNumSegment()

Adds an alphanumeric data segment

public addAlphaNumSegment(string $data) : self

ISO/IEC 18004:2000 8.3.3 - Alphanumeric Mode

Parameters
$data : string
Return values
self

addByteSegment()

Adds an 8-bit byte data segment

public addByteSegment(string $data) : self

ISO/IEC 18004:2000 8.3.4 - 8-bit Byte Mode

Parameters
$data : string
Return values
self

addEciDesignator()

Adds a standalone ECI designator

public addEciDesignator(int $encoding) : self

ISO/IEC 18004:2000 8.3.1 - Extended Channel Interpretation (ECI) Mode

Parameters
$encoding : int
Return values
self

addEciSegment()

Adds an ECI data segment (including designator)

public addEciSegment(int $encoding, string $data) : self

i hate this somehow but i'll leave it for now

Parameters
$encoding : int
$data : string
Tags
throws
QRCodeException
Return values
self

addKanjiSegment()

Adds a Kanji data segment

public addKanjiSegment(string $data) : self

ISO/IEC 18004:2000 8.3.5 - Kanji Mode

Parameters
$data : string
Return values
self

addNumericSegment()

Adds a numeric data segment

public addNumericSegment(string $data) : self

ISO/IEC 18004:2000 8.3.2 - Numeric Mode

Parameters
$data : string
Return values
self

clearSegments()

Clears the data segments array

public clearSegments() : self
Return values
self

isAlphaNum()

checks if a string qualifies as alphanumeric (convenience method)

public isAlphaNum(string $string) : bool
Parameters
$string : string
Tags
deprecated
5.0.0
see
AlphaNum::validateString()
codeCoverageIgnore
Return values
bool

isByte()

a dummy (convenience method)

public isByte(string $string) : bool
Parameters
$string : string
Tags
deprecated
5.0.0
see
Byte::validateString()
codeCoverageIgnore
Return values
bool

isKanji()

checks if a string qualifies as Kanji (convenience method)

public isKanji(string $string) : bool
Parameters
$string : string
Tags
deprecated
5.0.0
see
Kanji::validateString()
codeCoverageIgnore
Return values
bool

isNumber()

checks if a string qualifies as numeric (convenience method)

public isNumber(string $string) : bool
Parameters
$string : string
Tags
deprecated
5.0.0
see
Number::validateString()
codeCoverageIgnore
Return values
bool

readFromBlob()

Reads a QR Code from the given data blob

public readFromBlob(string $blob) : DecoderResult
Parameters
$blob : string
Return values
DecoderResult

render()

Renders a QR Code for the given $data and QROptions

public render([string $data = null ][, string $file = null ]) : mixed
Parameters
$data : string = null
$file : string = null
Return values
mixed

addSegment()

Adds a data segment

protected addSegment(QRDataModeInterface $segment) : void

ISO/IEC 18004:2000 8.3.6 - Mixing modes ISO/IEC 18004:2000 Annex H - Optimisation of bit stream length

Parameters
$segment : QRDataModeInterface
Return values
void

Search results