{"id":17846436,"url":"https://github.com/technicalguru/php-qrcode","last_synced_at":"2025-03-20T07:30:44.262Z","repository":{"id":57066126,"uuid":"267065895","full_name":"technicalguru/php-qrcode","owner":"technicalguru","description":"A composer-compatible fork of deltalab's tcpdf lightweight QR Code generator","archived":false,"fork":false,"pushed_at":"2022-10-30T10:02:23.000Z","size":99,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-17T15:55:38.539Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/technicalguru.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-26T14:29:12.000Z","updated_at":"2023-05-09T08:17:46.000Z","dependencies_parsed_at":"2022-08-24T14:53:59.656Z","dependency_job_id":null,"html_url":"https://github.com/technicalguru/php-qrcode","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technicalguru%2Fphp-qrcode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technicalguru%2Fphp-qrcode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technicalguru%2Fphp-qrcode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technicalguru%2Fphp-qrcode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/technicalguru","download_url":"https://codeload.github.com/technicalguru/php-qrcode/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244570546,"owners_count":20474090,"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":[],"created_at":"2024-10-27T21:39:56.520Z","updated_at":"2025-03-20T07:30:39.252Z","avatar_url":"https://github.com/technicalguru.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# technicalguru/qrcode\r\nThis is PHP implementation of QR Code 2-D barcode generator. It is pure-php\r\nLGPL-licensed implementation based on C libqrencode by Kentaro Fukuchi.\r\nThis fork was restructured to work in a special namespace and with composer.\r\n\r\n# LICENSE\r\nThis project is licensed under [GNU LGPL 3.0](LICENSE.md).\r\n\r\n# INSTALLATION AND USAGE\r\n\r\n## By Composer\r\n\r\n```\r\ncomposer install technicalguru/qrcode\r\n```\r\n\r\n## By Package Download\r\nYou can download the source code packages from [GitHub Release Page](https://github.com/technicalguru/php-qrcode/releases)\r\n\r\n# SIMPLE EXAMPLE USAGE\r\n\r\n```\r\n$text = 'This is an example QR code';\r\n$file = __DIR__.'/example-qr.png';\r\n\r\n\\QR\\QRcode::png($text, $file, QR_ECLEVEL_L, 8);\r\n\r\necho 'QR code saved at '.$file;\r\n\r\n```\r\n\r\n# ADVANCED EXAMPLE USAGE\r\n\r\n```\r\n\u003c?php\r\ninclude 'vendor/autoload.php';\r\n\r\n// set it to writable location, a place for temp generated PNG file\r\n$PNG_TEMP_DIR = dirname(__FILE__).DIRECTORY_SEPARATOR.'qrcodes'.DIRECTORY_SEPARATOR;\r\n\r\n// html PNG location prefix\r\n$PNG_WEB_DIR = 'qrcodes/';\r\n\r\n// of course we need rights to create temp dir\r\nif (!file_exists($PNG_TEMP_DIR)) {\r\n    mkdir($PNG_TEMP_DIR);\r\n}\r\n\r\n$filename = $PNG_TEMP_DIR.'test.png';\r\n\r\n// processing form input\r\n// remember to sanitize user input in real-life solution !!!\r\n$errorCorrectionLevel = 'L';\r\nif (isset($_REQUEST['level']) \u0026\u0026 in_array($_REQUEST['level'], array('L','M','Q','H'))) {\r\n    $errorCorrectionLevel = $_REQUEST['level'];\r\n}\r\n\r\n$matrixPointSize = 4;\r\nif (isset($_REQUEST['size'])) {\r\n    $matrixPointSize = min(max((int)$_REQUEST['size'], 1), 10);\r\n}\r\n\r\nif (isset($_REQUEST['data'])) {\r\n\r\n    // it's very important!\r\n    if (trim($_REQUEST['data']) == '')\r\n        die('data cannot be empty! \u003ca href=\"?\"\u003eback\u003c/a\u003e');\r\n\r\n    // user data\r\n    $filename = $PNG_TEMP_DIR.'test'.md5($_REQUEST['data'].'|'.$errorCorrectionLevel.'|'.$matrixPointSize).'.png';\r\n    \\QR\\QRcode::png($_REQUEST['data'], $filename, $errorCorrectionLevel, $matrixPointSize, 2);\r\n\r\n} else {\r\n\r\n    // default data\r\n    echo 'You can provide data in GET parameter: \u003ca href=\"?data=like_that\"\u003elike that\u003c/a\u003e\u003chr/\u003e';\r\n    \\QR\\QRcode::png('PHP QR Code :)', $filename, $errorCorrectionLevel, $matrixPointSize, 2);\r\n\r\n}\r\n\r\n// display generated file\r\necho '\u003cimg src=\"'.$PNG_WEB_DIR.basename($filename).'\" /\u003e\u003chr/\u003e';\r\n\r\n// config form\r\necho '\u003cform method=\"post\"\u003e\r\n    Data:\u0026nbsp;\u003cinput name=\"data\" value=\"'.(isset($_REQUEST['data'])?htmlspecialchars($_REQUEST['data']):'PHP QR Code :)').'\" /\u003e\u0026nbsp;\r\n    ECC:\u0026nbsp;\u003cselect name=\"level\"\u003e\r\n        \u003coption value=\"L\"'.(($errorCorrectionLevel=='L')?' selected':'').'\u003eL - smallest\u003c/option\u003e\r\n        \u003coption value=\"M\"'.(($errorCorrectionLevel=='M')?' selected':'').'\u003eM\u003c/option\u003e\r\n        \u003coption value=\"Q\"'.(($errorCorrectionLevel=='Q')?' selected':'').'\u003eQ\u003c/option\u003e\r\n        \u003coption value=\"H\"'.(($errorCorrectionLevel=='H')?' selected':'').'\u003eH - best\u003c/option\u003e\r\n    \u003c/select\u003e\u0026nbsp;\r\n    Size:\u0026nbsp;\u003cselect name=\"size\"\u003e';\r\n\r\nfor ($i=1; $i\u003c=10; $i++) {\r\n    echo '\u003coption value=\"'.$i.'\"'.(($matrixPointSize==$i)?' selected':'').'\u003e'.$i.'\u003c/option\u003e';\r\n}\r\n\r\necho '\u003c/select\u003e\u0026nbsp;\r\n    \u003cinput type=\"submit\" value=\"GENERATE\"\u003e\u003c/form\u003e\u003chr/\u003e';\r\n\r\n```\r\n\r\n# CONTRIBUTION\r\nReport a bug, request an enhancement or pull request at the [GitHub Issue Tracker](https://github.com/technicalguru/php-qrcode/issues).\r\nFell free to contact me via e-mail (deltalab at poczta dot fm) or using\r\nfolowing project pages:\r\n\r\n# ACKNOWLEDGMENTS\r\n\r\nBased on phpqrcode at SourceForge by Dominik Dzienia:\r\n\r\n* [https://sourceforge.net/projects/phpqrcode/]()\r\n* [https://phpqrcode.sourceforge.net/]()\r\n  \r\nBased on C libqrencode library (ver. 3.1.1) \r\nCopyright (C) 2006-2010 by Kentaro Fukuchi\r\nhttp://megaui.net/fukuchi/works/qrencode/index.en.html\r\n\r\nQR Code is registered trademarks of DENSO WAVE INCORPORATED in JAPAN and other\r\ncountries.\r\n\r\nReed-Solomon code encoder is written by Phil Karn, KA9Q.\r\nCopyright (C) 2002, 2003, 2004, 2006 Phil Karn, KA9Q\r\n \r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechnicalguru%2Fphp-qrcode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftechnicalguru%2Fphp-qrcode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechnicalguru%2Fphp-qrcode/lists"}