{"id":17355074,"url":"https://github.com/hezhizheng/free-pic","last_synced_at":"2025-04-14T23:10:54.677Z","repository":{"id":56987882,"uuid":"308572518","full_name":"hezhizheng/free-pic","owner":"hezhizheng","description":"free-pic 一个第三方免费图床扩展包   free image-hosting","archived":false,"fork":false,"pushed_at":"2023-12-03T16:02:55.000Z","size":66,"stargazers_count":22,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-28T11:11:41.611Z","etag":null,"topics":["free","image-hosting","php","picture"],"latest_commit_sha":null,"homepage":"http://117.50.186.143:5000/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hezhizheng.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-30T08:45:26.000Z","updated_at":"2024-12-20T05:16:03.000Z","dependencies_parsed_at":"2022-08-21T12:50:23.645Z","dependency_job_id":null,"html_url":"https://github.com/hezhizheng/free-pic","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hezhizheng%2Ffree-pic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hezhizheng%2Ffree-pic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hezhizheng%2Ffree-pic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hezhizheng%2Ffree-pic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hezhizheng","download_url":"https://codeload.github.com/hezhizheng/free-pic/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248975316,"owners_count":21192210,"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":["free","image-hosting","php","picture"],"created_at":"2024-10-15T17:42:11.108Z","updated_at":"2025-04-14T23:10:54.651Z","avatar_url":"https://github.com/hezhizheng.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## free-pic 一个第三方免费图床扩展包 \n\n\u003e [体验demo](http://117.50.186.143:5000/)\n\n\u003e [github 地址](https://github.com/hezhizheng/free-pic)\n\n\u003e [packagist 地址](https://packagist.org/packages/hzz/free-pic)\n\n\n## feature\n- 三无图床（\"无存储限制\" | \"无需上传凭证\" | \"无同源跨域检测\"）\n- 简单易用、方便扩展\n- 支持 常见 \"gif\", \"jpeg\", \"jpg\", \"png\" 图片格式\n\n## 支持图床\n- [sm.ms](https://smms.app/)\n- [imgBB](https://imgbb.com/upload)\n- [FreeImageHost](https://freeimage.host/)\n- [CatBox](https://catbox.moe)\n- ...找到其他三无图床就再扩展\n\n## 使用\n下载安装\n```\ncomposer require hzz/free-pic dev-master\n```\n\n上传图片到第三方图床 (完整调用过程)\n```php\n\n// 配置项\n$config = [\n    'sm' =\u003e [ // sm 需要token ，不使用可无须配置\n        \"token\" =\u003e \"Yuc4fb0BuwsOnd4y7R0zFp0tVGkxYgRa22\"\n    ],\n    'debug' =\u003e true,\n    'log' =\u003e [\n        'name' =\u003e 'img_hosting',\n        'file' =\u003e __DIR__ . '/img_hosting.log',\n        'level' =\u003e 'debug',\n        'permission' =\u003e 0777,\n    ],\n];\n\n$params = [\n    \"filepath\" =\u003e \"图片的绝对路径\",\n];\n// 实例化\n$freePic = new \\Hzz\\FreePic($config);\n// 上传 , 同理 可用 -\u003esm , -\u003efreeImageHost , -\u003ecatBox 调用对应的服务\n$res = $freePic-\u003eimgBB-\u003eupload($params); // 这里返回的是对应图床服务器返回的上传结果数据。\n// getUrl方法 可获取实际\n$url = $freePic-\u003eimgBB-\u003egetUrl($res);\n```\n\n详细用法可参考 [tests](./tests/UploadTest.php) 用例 或 [upload.php](./tests/upload.php)\n\n## License\n[MIT](./LICENSE.txt)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhezhizheng%2Ffree-pic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhezhizheng%2Ffree-pic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhezhizheng%2Ffree-pic/lists"}