{"id":17176353,"url":"https://github.com/phalapi/qrcode","last_synced_at":"2025-04-13T17:08:53.684Z","repository":{"id":57038483,"uuid":"111554261","full_name":"phalapi/qrcode","owner":"phalapi","description":"PhalApi 二维码扩展，基于QRCode实现。","archived":false,"fork":false,"pushed_at":"2017-12-29T12:03:10.000Z","size":152,"stargazers_count":7,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-27T07:51:41.202Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phalapi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-21T13:44:15.000Z","updated_at":"2024-05-27T08:55:58.000Z","dependencies_parsed_at":"2022-08-23T21:00:32.329Z","dependency_job_id":null,"html_url":"https://github.com/phalapi/qrcode","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phalapi%2Fqrcode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phalapi%2Fqrcode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phalapi%2Fqrcode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phalapi%2Fqrcode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phalapi","download_url":"https://codeload.github.com/phalapi/qrcode/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248470772,"owners_count":21109295,"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-15T00:00:00.051Z","updated_at":"2025-04-13T17:08:53.638Z","avatar_url":"https://github.com/phalapi.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 二维码扩展\n\nPhalApi 二维码扩展，基于[PHP QRCode](http://phpqrcode.sourceforge.net)实现。可用于生成二维码图片。  \n\n\n## 安装和配置\n修改项目下的composer.json文件，并添加：  \n```\n    \"phalapi/qrcode\":\"dev-master\"\n```\n然后执行```composer update```。  \n\n## 注册\n在/path/to/phalapi/config/di.php文件中，注册：  \n```php\n$di-\u003eqrcode = function() {\n    return new \\PhalApi\\QrCode\\Lite();\n};\n```\n\n## 使用\n第一种使用方式：直接输出二维码图片：\n```php\n\\PhalApi\\DI()-\u003eqrcode-\u003epng('Hello PhalApi!', false, 'L', 4);\n```\n\n效果类似如下：  \n![](http://7xiz2f.com1.z0.glb.clouddn.com/20171121225722_9b8f48f3986e2026363584dba7c56621)\n\n或者直接浏览器访问：[http://api.phalapi.net/?s=QrCode.Png\u0026data=Hello%20PhalApi!\u0026size=10](http://api.phalapi.net/?s=QrCode.Png\u0026data=Hello%20PhalApi!\u0026size=10)  \n\n第二种使用方式：将二维码图片保存到文件。\n```\n\\PhalApi\\DI()-\u003eqrcode-\u003epng('Hello PhalApi!', '/path/to/your_file.png', 'L', 4);\n```\n\n## 代码示例\n可参考[PhalApi的示例源代码](https://github.com/phalapi/phalapi/blob/master-2x/src/app/Api/Examples/QrCode.php)。","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphalapi%2Fqrcode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphalapi%2Fqrcode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphalapi%2Fqrcode/lists"}