{"id":17176360,"url":"https://github.com/phalapi/qiniu","last_synced_at":"2025-04-13T17:08:50.889Z","repository":{"id":57038488,"uuid":"102172176","full_name":"phalapi/qiniu","owner":"phalapi","description":"PhalApi 2.x 扩展类库：七牛云存储接口调用","archived":false,"fork":false,"pushed_at":"2019-06-26T13:39:57.000Z","size":161,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-17T07:02:17.527Z","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-09-02T04:18:33.000Z","updated_at":"2022-01-04T11:46:03.000Z","dependencies_parsed_at":"2022-08-24T00:51:14.874Z","dependency_job_id":null,"html_url":"https://github.com/phalapi/qiniu","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%2Fqiniu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phalapi%2Fqiniu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phalapi%2Fqiniu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phalapi%2Fqiniu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phalapi","download_url":"https://codeload.github.com/phalapi/qiniu/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240105433,"owners_count":19748462,"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:01.467Z","updated_at":"2025-02-23T19:31:25.743Z","avatar_url":"https://github.com/phalapi.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 七牛扩展\nPhalApi 2.x扩展类库，基于Qiniu的七牛CDN扩展。\n\n## 安装和配置\n修改项目下的composer.json文件，并添加：  \n```\n    \"phalapi/qiniu\":\"dev-master\"\n```\n然后执行```composer update```。  \n\n安装成功后，添加以下配置到/path/to/phalapi/config/app.php文件：  \n```php\n    /**\n     * 七牛相关配置\n     */\n    'Qiniu' =\u003e  array(\n        //统一的key\n        'access_key' =\u003e '*****',\n        'secret_key' =\u003e '****',\n        //自定义配置的空间\n        'space_bucket' =\u003e '自定义配置的空间',\n        'space_host' =\u003e 'http://XXXXX.qiniudn.com', // 如果有配置此项，则优先使用此域名\n        'preffix' =\u003e '', // 上传文件名前缀\n        //'upload_url' =\u003e '', // 提示：incorrect region, please use up-z2.qiniup.com，请配置此域名\n    ),\n```\n并根据自己的情况修改填充。 \n\n## 注册\n在/path/to/phalapi/config/di.php文件中，注册：  \n```php\n$di-\u003eqiniu = function() {\n        return new \\PhalApi\\Qiniu\\Lite();\n};\n```\n\n## 使用\n第一种使用方式：使用七牛上传本地文件：\n```php\n$url = \\PhalApi\\DI()-\u003eqiniu-\u003euploadFile($file);\n```\n\n第二种使用方式：或者，直接使用已经提供的默认上传接口。在composer.json中追加配置：\n```\n\"autoload\": {\n    \"psr-4\": {\n        \"Qiniu\\\\\": \"vendor/phalapi/qiniu/src/qiniu\"\n    }\n}\n```\n打开在线接口文档列表，即可看到七牛的接口。  \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphalapi%2Fqiniu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphalapi%2Fqiniu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphalapi%2Fqiniu/lists"}