Download the PHP package abduns/qrcode without Composer

On this page you can find all versions of the php package abduns/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

abduns/qrcode

A from-scratch, framework-agnostic QR Code generator for PHP 8.2+ with zero required runtime dependencies. Implements ISO/IEC 18004 byte-exact: data encoding, Reed–Solomon error correction, block interleaving, all 8 mask patterns with spec-correct penalty scoring, and three renderers (SVG, PNG via ext-gd, monospace console).

Latest version PHP version CI Downloads

For Laravel apps, see the bridge package abduns/laravel-qrcode.

Features

Table of contents

Install

PHP 8.2+. Zero runtime dependencies. ext-gd is needed only if you use GdPngRenderer for PNG output — SVG and console renderers have no extension requirements.

Quick start

The builder is immutable — each setter returns a new instance. The result is a read-only QrCode value object exposing matrix, version, eccLevel, mode, and maskPattern.

Payload helpers

The encoder is data-agnostic, but most QR codes carry one of a handful of well-known formats (URL, vCard, WiFi join, mailto, …). Dunn\QrCode\Payload ships immutable value objects for each and QrCode exposes a matching static factory that returns a configured Builder. The wire format is built for you according to the relevant RFC / convention, with proper escaping.

Type Factory Wire format
URL / Link QrCode::url($url) passes the URL through
Plain text QrCode::text($text) passes the text through
Phone (tel:) QrCode::phone($number) RFC 3966
SMS QrCode::sms($number, body: ...) SMSTO: (or sms: URI)
Email (mailto:) QrCode::email($to, subject:, body:, cc:, bcc:) RFC 6068
Geo QrCode::geo($lat, $lng, label: ...) RFC 5870
WiFi QrCode::wifi($ssid, $pwd, $auth, $hidden) Wi-Fi Alliance WIFI:
vCard QrCode::vCard($card) RFC 2426 (vCard 3.0)
Calendar event QrCode::event($event) RFC 5545 (VEVENT)

Each factory returns the same Builder you get from QrCode::create(), so the rest of the pipeline (error correction, mode forcing, rendering) is unchanged:

All payload value objects implement \Stringable, so you can also hand them to QrCode::create() directly: QrCode::create($card)->build() works identically to QrCode::vCard($card). Invalid inputs (empty SSID, latitude out of range, end-before-start event, …) throw Dunn\QrCode\Exception\PayloadException.

Renderers

All renderers share the Dunn\QrCode\Renderer\Renderer interface:

Styling

The SVG renderer paints three regions independently — data dots, marker outer ring, marker inner pupil — plus an optional center logo. Each region can have its own shape and colour:

Shapes

Region Default Alternatives
moduleShape (data) SquareModule DotModule, RoundedModule
eyeOuter (marker border) SquareEyeOuter CircleEyeOuter, RoundedEyeOuter
eyeInner (marker center) SquareEyeInner CircleEyeInner, RoundedEyeInner

Mix and match — e.g. CircleEyeOuter + SquareEyeInner gives a round border around a square pupil. RoundedModule is neighbour-aware: corners are rounded only when both adjacent neighbours are absent, so adjacent modules merge into pills, L-shapes, and larger blobs as the data dictates.

Colours and gradients

Every paint parameter accepts a Color, a Gradient, or a hex string. Unspecified per-region paints fall back to the foreground paint.

Color provides Color::hex(), Color::rgb(), Color::rgba(), plus named factories Color::black() / Color::white(). Gradients with RGBA stops emit stop-opacity so semi-transparent gradients work.

Logos

Logo accepts raw bytes + MIME or loads from a file via Logo::fromFile($path, sizeRatio). Supports SVG, PNG, JPEG, GIF. The renderer validates the logo size against the QR's error-correction level and throws InvalidConfigurationException if oversized. Safe maximum linear ratios:

ECC Max ratio Recommended ratio
Low 0.26 ≤ 0.15
Medium 0.38 ≤ 0.20
Quartile 0.50 ≤ 0.25
High 0.54 ≤ 0.30

Examples gallery

Four copy-pasteable presets covering the customization surface. All share the same QrCode build:

Classic — plain black-and-white square modules with square markers:

Dotted — round modules, round markers, single brand colour:

Rounded with gradient — neighbour-aware rounded modules, rounded markers, linear-gradient dots:

Branded — per-region colours plus a centre logo:

Builder reference

Defaults: EccLevel::Medium, auto-version (smallest that fits), auto-mode (smallest single mode that fits).

Error handling

All exceptions extend Dunn\QrCode\Exception\QrCodeException (which extends RuntimeException), so a single catch can isolate library failures:

Limitations

Known v1.0.x boundaries — tracked for v1.x minor releases or a future v2:

Spec correctness

Every byte-level transformation is verified against ISO/IEC 18004 Annex I worked examples or Thonky's canonical tutorial:

Versioning

abduns/qrcode follows Semantic Versioning from v1.0 onwards. The following surface is committed — v1.x will only break on a major (v2.0) bump:

Internal classes (Math\*, ErrorCorrection\*, Matrix\*, Mask\*, Tables\*, and Encoder\* excluding Mode) may change between minor versions and are not part of the SemVer contract.

See MIGRATION.md for upgrade paths across pre-1.0 releases.

Development

CI runs the same composer ci matrix on PHP 8.2, 8.3, and 8.4 — see .github/workflows/ci.yml.

Contributing

Issues and pull requests are welcome on GitHub.

Before opening a PR:

  1. Open an issue first for non-trivial changes so we can agree on the approach.
  2. Run composer ci locally — Pest, PHPStan level 8, and php-cs-fixer must all pass.
  3. Cover new code with Pest tests. The existing suite uses Pest 3; match the style.
  4. Follow PSR-12 plus the :risky ruleset in .php-cs-fixer.php. declare(strict_types=1) is required in every file.
  5. No new runtime dependencies without prior discussion — zero-deps is a core design constraint.
  6. Spec-correctness changes to encoding, ECC, or matrix construction should reference the ISO/IEC 18004 clause or Annex I example they're verified against.

Security

If you discover a security vulnerability, please report it privately via GitHub Security Advisories rather than opening a public issue. We'll acknowledge receipt within a few days and coordinate disclosure.

Credits

License

Released under the MIT License. Copyright © 2026 Abduns.


All versions of qrcode with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
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 abduns/qrcode contains the following files

Loading the files please wait ...