{"id":13549293,"url":"https://github.com/chillerlan/php-qrcode","last_synced_at":"2025-05-16T01:03:36.535Z","repository":{"id":37502820,"uuid":"47144009","full_name":"chillerlan/php-qrcode","owner":"chillerlan","description":"A PHP QR Code generator and reader with a user-friendly API.","archived":false,"fork":false,"pushed_at":"2025-05-01T14:19:32.000Z","size":24206,"stargazers_count":2151,"open_issues_count":4,"forks_count":309,"subscribers_count":47,"default_branch":"main","last_synced_at":"2025-05-08T03:57:09.917Z","etag":null,"topics":["drupal-module","imagemagick","let-php5-die","php","php-library","php5-is-dead","php7","php7-is-dead","php8","phpqrcode","qr-code","qr-generator","qr-reader","qrcode","qrcode-generator","qrcode-reader","qrcode-scanner","svg","wordpress-plugin"],"latest_commit_sha":null,"homepage":"https://smiley.codes/qrcode/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chillerlan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE-ASL-2.0","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"ko_fi":"codemasher"}},"created_at":"2015-11-30T20:27:07.000Z","updated_at":"2025-05-07T14:08:19.000Z","dependencies_parsed_at":"2023-10-04T21:02:24.645Z","dependency_job_id":"f8923e94-a2c5-4586-b6de-6f7d86ab8619","html_url":"https://github.com/chillerlan/php-qrcode","commit_stats":{"total_commits":911,"total_committers":9,"mean_commits":"101.22222222222223","dds":0.2941822173435785,"last_synced_commit":"c8c37a4e36300f1fc4a7fb44ee22186eac1e60a4"},"previous_names":[],"tags_count":41,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chillerlan%2Fphp-qrcode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chillerlan%2Fphp-qrcode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chillerlan%2Fphp-qrcode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chillerlan%2Fphp-qrcode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chillerlan","download_url":"https://codeload.github.com/chillerlan/php-qrcode/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253002856,"owners_count":21838640,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["drupal-module","imagemagick","let-php5-die","php","php-library","php5-is-dead","php7","php7-is-dead","php8","phpqrcode","qr-code","qr-generator","qr-reader","qrcode","qrcode-generator","qrcode-reader","qrcode-scanner","svg","wordpress-plugin"],"created_at":"2024-08-01T12:01:20.307Z","updated_at":"2025-05-08T22:18:51.802Z","avatar_url":"https://github.com/chillerlan.png","language":"PHP","readme":"# chillerlan/php-qrcode\n\nA PHP QR Code generator based on the [implementation by Kazuhiko Arase](https://github.com/kazuhikoarase/qrcode-generator), namespaced, cleaned up, improved and other stuff. \u003cbr\u003e\nIt 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).\n\n**Attention:** there is now also a javascript port on NPM: [@chillerlan/qrcode](https://www.npmjs.com/package/@chillerlan/qrcode).\n\n[![PHP Version Support][php-badge]][php]\n[![Packagist version][packagist-badge]][packagist]\n[![Continuous Integration][gh-action-badge]][gh-action]\n[![CodeCov][coverage-badge]][coverage]\n[![Codacy][codacy-badge]][codacy]\n[![Packagist downloads][downloads-badge]][downloads]\n[![Documentation][readthedocs-badge]][readthedocs]\n\n[php-badge]: https://img.shields.io/packagist/php-v/chillerlan/php-qrcode?logo=php\u0026color=8892BF\u0026logoColor=fff\n[php]: https://www.php.net/supported-versions.php\n[packagist-badge]: https://img.shields.io/packagist/v/chillerlan/php-qrcode.svg?logo=packagist\u0026logoColor=fff\n[packagist]: https://packagist.org/packages/chillerlan/php-qrcode\n[gh-action-badge]: https://img.shields.io/github/actions/workflow/status/chillerlan/php-qrcode/ci.yml?branch=main\u0026logo=github\u0026logoColor=fff\n[gh-action]: https://github.com/chillerlan/php-qrcode/actions/workflows/ci.yml?query=branch%3Amain\n[coverage-badge]: https://img.shields.io/codecov/c/github/chillerlan/php-qrcode/main?logo=codecov\u0026logoColor=fff\n[coverage]: https://app.codecov.io/gh/chillerlan/php-qrcode/tree/main\n[codacy-badge]: https://img.shields.io/codacy/grade/edccfc4fe5a34b74b1c53ee03f097b8d/main?logo=codacy\u0026logoColor=fff\n[codacy]: https://app.codacy.com/gh/chillerlan/php-qrcode/dashboard?branch=main\n[downloads-badge]: https://img.shields.io/packagist/dt/chillerlan/php-qrcode?logo=packagist\u0026logoColor=fff\n[downloads]: https://packagist.org/packages/chillerlan/php-qrcode/stats\n[readthedocs-badge]: https://img.shields.io/readthedocs/php-qrcode/main?logo=readthedocs\u0026logoColor=fff\n[readthedocs]: https://php-qrcode.readthedocs.io/en/main/\n\n# Overview\n\n## Features\n\n- Creation of [Model 2 QR Codes](https://www.qrcode.com/en/codes/model12.html), [Version 1 to 40](https://www.qrcode.com/en/about/version.html)\n- [ECC Levels](https://www.qrcode.com/en/about/error_correction.html) L/M/Q/H supported\n- Mixed mode support (encoding modes can be combined within a QR symbol). Supported modes:\n  - numeric\n  - alphanumeric\n  - 8-bit binary\n    - [ECI support](https://en.wikipedia.org/wiki/Extended_Channel_Interpretation)\n  - 13-bit double-byte:\n    - kanji (Japanese, Shift-JIS)\n    - hanzi (simplified Chinese, GB2312/GB18030) as [defined in GBT18284-2000](https://www.chinesestandard.net/PDF/English.aspx/GBT18284-2000)\n- Flexible, easily extensible output modules, built-in support for the following output formats:\n  - [GdImage](https://www.php.net/manual/book.image) (raster graphics: avif, bmp, gif, jpeg, png, webp)\n  - [ImageMagick](https://www.php.net/manual/book.imagick) ([multiple supported image formats](https://imagemagick.org/script/formats.php))\n  - Markup types: SVG, HTML, etc.\n  - String types: JSON, plain text, etc.\n  - Encapsulated Postscript (EPS)\n  - PDF via [FPDF](https://github.com/setasign/fpdf)\n- QR Code reader (via GD and ImageMagick)\n\n\n## Requirements\n\n- PHP 8.2+\n  - [`ext-mbstring`](https://www.php.net/manual/book.mbstring.php)\n  - optional:\n    - [`ext-gd`](https://www.php.net/manual/book.image) for `QRGdImage` based output\n    - [`ext-imagick`](https://github.com/Imagick/imagick) with [ImageMagick](https://imagemagick.org) installed\n    - [`ext-fileinfo`](https://www.php.net/manual/book.fileinfo.php) required by `QRImagick` output\n    - [`setasign/fpdf`](https://github.com/setasign/fpdf) for the PDF output module\n    - [`intervention/image`](https://github.com/Intervention/image) for alternative GD/ImageMagick output\n\nFor the QR Code reader, either `ext-gd` or `ext-imagick` is required!\n\n\n# Documentation\n\n- The user manual is at https://php-qrcode.readthedocs.io/ ([sources](https://github.com/chillerlan/php-qrcode/tree/main/docs))\n- An API documentation created with [phpDocumentor](https://www.phpdoc.org/) can be found at https://chillerlan.github.io/php-qrcode/\n- The documentation for the `QROptions` container is here: [chillerlan/php-settings-container](https://github.com/chillerlan/php-settings-container#readme)\n- Benchmark results can be found in the [`benchmark` branch](https://github.com/chillerlan/php-qrcode/tree/benchmark/markdown)\n\n**Important: Please use the examples from the branch that matches your installed php-qrcode version (\n[v4.x](https://github.com/chillerlan/php-qrcode/tree/v4.3.x/examples),\n[v5.x](https://github.com/chillerlan/php-qrcode/tree/v5.0.x/examples),\n[dev-main](https://github.com/chillerlan/php-qrcode/tree/main/examples)\n)!**\u003cbr/\u003e\nThe `main` (default) branch is the active development for future major versions, and it is most likely incompatible with the latest release versions.\n\n## Installation with [composer](https://getcomposer.org)\n\nSee [the installation guide](https://php-qrcode.readthedocs.io/en/main/Usage/Installation.html) for more info!\n\n\n### Terminal\n\n```\ncomposer require chillerlan/php-qrcode\n```\n\n\n### composer.json\n\n```json\n{\n\t\"require\": {\n\t\t\"php\": \"^8.2\",\n\t\t\"chillerlan/php-qrcode\": \"dev-main#\u003ccommit_hash\u003e\"\n\t}\n}\n```\n\nNote: replace `dev-main` with a [version constraint](https://getcomposer.org/doc/articles/versions.md#writing-version-constraints), e.g. `^5.0` - see [releases](https://github.com/chillerlan/php-qrcode/releases) for valid versions.\n\n\n## Quickstart\n\nWe want to encode this URI for a mobile authenticator into a QRcode image:\n\n```php\n$data = 'otpauth://totp/test?secret=B3JX4VCVJDVNXNZ5\u0026issuer=chillerlan.net';\n\n// quick and simple:\necho '\u003cimg src=\"'.(new QRCode)-\u003erender($data).'\" alt=\"QR Code\" /\u003e';\n```\n\nWait, what was that? Please again, slower! See [Advanced usage](https://php-qrcode.readthedocs.io/en/main/Usage/Advanced-usage.html) in the manual.\nAlso, have a look [in the examples folder](https://github.com/chillerlan/php-qrcode/tree/main/examples) for some more usage examples.\n\n\u003cp align=\"center\"\u003e\n\t\u003cimg alt=\"QR codes are awesome!\" style=\"width: auto; height: 530px;\" src=\"https://raw.githubusercontent.com/chillerlan/php-qrcode/main/.github/images/example.svg\"\u003e\n\u003c/p\u003e\n\n\n## Reading QR Codes\n\nUsing the built-in QR Code reader is pretty straight-forward:\n\n```php\n// it's generally a good idea to wrap the reader in a try/catch block because it WILL throw eventually\ntry{\n\t$result = (new QRCode)-\u003ereadFromFile('path/to/file.png'); // -\u003e DecoderResult\n\n\t// you can now use the result instance...\n\t$content = $result-\u003edata;\n\t$matrix  = $result-\u003egetMatrix(); // -\u003e QRMatrix\n\n\t// ...or simply cast it to string to get the content:\n\t$content = (string)$result;\n}\ncatch(Throwable $e){\n\t// oopsies!\n}\n```\n\n\n# Shameless advertising\n\nHi, please check out some of my other projects that are way cooler than qrcodes!\n\n- [js-qrcode](https://github.com/chillerlan/js-qrcode) - a javascript port of this library\n- [php-authenticator](https://github.com/chillerlan/php-authenticator) - a Google Authenticator implementation (see [authenticator example](https://github.com/chillerlan/php-qrcode/blob/main/examples/authenticator.php))\n- [php-httpinterface](https://github.com/chillerlan/php-httpinterface) - a PSR-7/15/17/18 implemetation\n- [php-oauth](https://github.com/chillerlan/php-oauth) - an OAuth 1/2 client library, fully PSR-7/PSR-17/PSR-18 compatible\n- [php-database](https://github.com/chillerlan/php-database) - a database client \u0026 querybuilder for MySQL, Postgres, SQLite, MSSQL, Firebird\n- [php-tootbot](https://github.com/php-tootbot/tootbot-template) - a Mastodon bot library (see [@dwil](https://github.com/php-tootbot/dwil))\n\n\n# Disclaimer!\n\nI don't take responsibility for molten CPUs, misled applications, failed log-ins etc.. Use at your own risk!\n\n\n## License notice\n\n- Parts of this code are [ported to PHP](https://github.com/codemasher/php-qrcode-decoder) from the [ZXing project](https://github.com/zxing/zxing) and licensed under the [Apache License, Version 2.0](./NOTICE).\n- [The documentation](https://github.com/chillerlan/php-qrcode/tree/main/docs) is licensed under the [Creative Commons Attribution 4.0 International (CC BY 4.0) License](https://creativecommons.org/licenses/by/4.0/).\n\n\n## Trademark Notice\n\nThe word \"QR Code\" is a registered trademark of *DENSO WAVE INCORPORATED*\u003cbr\u003e\nhttps://www.qrcode.com/en/faq.html#patentH2Title\n","funding_links":["https://ko-fi.com/codemasher"],"categories":["PHP"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchillerlan%2Fphp-qrcode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchillerlan%2Fphp-qrcode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchillerlan%2Fphp-qrcode/lists"}