Download the PHP package phpdot/qrcode without Composer

On this page you can find all versions of the php package phpdot/qrcode. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package qrcode

phpdot/qrcode

Coroutine-safe QR code generation for the PHPdot ecosystem. Encode any string to a QR symbol and render it as SVG (a pure string, no extension), PNG (GD), a raw module matrix, or an inline data: URI — through one immutable, injectable factory. Encoding is delegated to the battle-tested bacon/bacon-qr-code (numeric, alphanumeric, byte and Kanji modes, ECI, all four error-correction levels, versions 1–40, automatic masking); everything bacon touches is fenced behind a single Encoder, and the rest of the package — the value objects, the renderers, the fluent builder — is plain PHPdot code.

Table of Contents

Requirements

Requirement Constraint
PHP >= 8.5
ext-gd *
bacon/bacon-qr-code ^3.0

ext-gd is used only by the PNG renderer; SVG, the data URI, and the raw matrix need no extension.

Installation

Usage

One-call helpers

Inject QrCodeFactory and call a format helper — each encodes with sensible defaults and returns the bytes directly:

svg(), png(), and dataUri() cover the common cases; make() returns the encoded QrCode value object without rendering, and create() opens a fluent build for anything more.

The fluent builder

create() returns an immutable QrCodeBuilder — every setter returns a new builder, so a configured builder is a safe reusable template. Terminal methods (toSvg(), toPng(), toDataUri(), toMatrix(), encode()) produce the output:

Colors and options

Color is an immutable RGBA value object with channels validated to 0–255; RenderOptions carries the size (target square edge in pixels, default 300) and margin (quiet-zone width in modules, default 4):

Encoding and ECI

Byte-mode content defaults to UTF-8 with an ECI segment, the specification-correct way to signal a non-ISO-8859-1 charset. Most modern scanners read it fine; for legacy hardware scanners that cannot, disable it with eci(false). ASCII content (URLs, numbers) is unaffected.

Architecture

QrCodeFactory is the injected #[Singleton] entry point; it hands out immutable QrCodeBuilder instances. A build asks Encoder — the single boundary to bacon/bacon-qr-code — to produce a QrCode carrying an immutable Matrix, then passes that matrix plus RenderOptions to a RendererInterface. The SVG renderer is a pure string (non-blocking, the default); the PNG renderer is a CPU-bound GD raster; the data-URI renderer wraps either and base64-encodes the result.

Testing

The PNG renderer is covered by a pixel round-trip test: a symbol is rendered, its pixels are read back, the matrix is reconstructed, and it is asserted equal to the source — so a renderer that painted the wrong cells fails even though the encoder itself is trusted.

License

MIT — see LICENSE.

This repository is a read-only mirror. The canonical source lives in phpdot/monorepo; pull requests and issues are handled there: pulls · issues.


All versions of qrcode with dependencies

PHP Build Version
Package Version
Requires php Version >=8.5
ext-gd Version *
bacon/bacon-qr-code Version ^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package phpdot/qrcode contains the following files

Loading the files please wait ...