{"id":15631864,"url":"https://github.com/freyo/flysystem-qcloud-cos-v3","last_synced_at":"2025-09-05T03:38:25.070Z","repository":{"id":62507442,"uuid":"88605543","full_name":"freyo/flysystem-qcloud-cos-v3","owner":"freyo","description":"💾 Flysystem Adapter for Tencent Qcloud COS SDK V3","archived":false,"fork":false,"pushed_at":"2017-09-14T08:57:19.000Z","size":65,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-17T04:27:48.490Z","etag":null,"topics":["flysystem-adapter","php","qcloud-sdk"],"latest_commit_sha":null,"homepage":"https://www.qcloud.com/product/cos","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/freyo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-18T09:13:09.000Z","updated_at":"2022-09-24T04:39:48.000Z","dependencies_parsed_at":"2022-11-02T10:16:01.640Z","dependency_job_id":null,"html_url":"https://github.com/freyo/flysystem-qcloud-cos-v3","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/freyo/flysystem-qcloud-cos-v3","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freyo%2Fflysystem-qcloud-cos-v3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freyo%2Fflysystem-qcloud-cos-v3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freyo%2Fflysystem-qcloud-cos-v3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freyo%2Fflysystem-qcloud-cos-v3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/freyo","download_url":"https://codeload.github.com/freyo/flysystem-qcloud-cos-v3/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freyo%2Fflysystem-qcloud-cos-v3/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273708692,"owners_count":25153726,"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","status":"online","status_checked_at":"2025-09-05T02:00:09.113Z","response_time":402,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["flysystem-adapter","php","qcloud-sdk"],"created_at":"2024-10-03T10:41:54.930Z","updated_at":"2025-09-05T03:38:20.052Z","avatar_url":"https://github.com/freyo.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# flysystem-qcloud-cos-v3\n\n[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)\n[![Build Status](https://img.shields.io/travis/freyo/flysystem-qcloud-cos-v3/master.svg?style=flat-square)](https://travis-ci.org/freyo/flysystem-qcloud-cos-v3)\n[![Coverage Status](https://img.shields.io/scrutinizer/coverage/g/freyo/flysystem-qcloud-cos-v3.svg?style=flat-square)](https://scrutinizer-ci.com/g/freyo/flysystem-qcloud-cos-v3)\n[![Quality Score](https://img.shields.io/scrutinizer/g/freyo/flysystem-qcloud-cos-v3.svg?style=flat-square)](https://scrutinizer-ci.com/g/freyo/flysystem-qcloud-cos-v3)\n[![Packagist Version](https://img.shields.io/packagist/v/freyo/flysystem-qcloud-cos-v3.svg?style=flat-square)](https://packagist.org/packages/freyo/flysystem-qcloud-cos-v3)\n[![Total Downloads](https://img.shields.io/packagist/dt/freyo/flysystem-qcloud-cos-v3.svg?style=flat-square)](https://packagist.org/packages/freyo/flysystem-qcloud-cos-v3)\n\nThis is a Flysystem adapter for the qcloud-cos-sdk-php v3.\n\n腾讯云COS对象存储 V3\n\n## Attention\n\nif you are a new registered user(after October 2016), [v4](https://packagist.org/packages/freyo/flysystem-qcloud-cos-v4) should be used.\n\n2016年10月以后新注册的用户默认使用[V4版本](https://packagist.org/packages/freyo/flysystem-qcloud-cos-v4)\n\nif you have used COS before October 2016, [v3](https://packagist.org/packages/freyo/flysystem-qcloud-cos-v3) can continue to use.\n\n2016年10月之前使用COS的用户可以继续使用[V3版本](https://packagist.org/packages/freyo/flysystem-qcloud-cos-v3)\n\n## Installation\n\n  ```shell\n  composer require freyo/flysystem-qcloud-cos-v3\n  ```\n\n## Bootstrap\n\n  ```php\n  \u003c?php\n  use Freyo\\Flysystem\\QcloudCOSv3\\Adapter;\n  use League\\Flysystem\\Filesystem;\n\n  include __DIR__ . '/vendor/autoload.php';\n\n  $config = [\n      'protocol' =\u003e 'http',\n      'domain' =\u003e 'your-domain',\n      'app_id' =\u003e 'your-app-id',\n      'secret_id' =\u003e 'your-secret-id',\n      'secret_key' =\u003e 'your-secret-key',\n      'timeout' =\u003e 60,\n      'bucket' =\u003e 'your-bucket-name',\n      'debug' =\u003e false,\n  ];\n\n  $adapter = new Adapter($config);\n  $filesystem = new Filesystem($adapter);\n  ```\n  \n### API\n\n```php\nbool $flysystem-\u003ewrite('file.md', 'contents');\n\nbool $flysystem-\u003ewriteStream('file.md', fopen('path/to/your/local/file.jpg', 'r'));\n\nbool $flysystem-\u003eupdate('file.md', 'new contents');\n\nbool $flysystem-\u003eupdateStram('file.md', fopen('path/to/your/local/file.jpg', 'r'));\n\nbool $flysystem-\u003erename('foo.md', 'bar.md');\n\nbool $flysystem-\u003ecopy('foo.md', 'foo2.md');\n\nbool $flysystem-\u003edelete('file.md');\n\nbool $flysystem-\u003ehas('file.md');\n\nstring|false $flysystem-\u003eread('file.md');\n\narray $flysystem-\u003elistContents();\n\narray $flysystem-\u003egetMetadata('file.md');\n\nint $flysystem-\u003egetSize('file.md');\n\nstring $flysystem-\u003egetUrl('file.md'); \n\nstring $flysystem-\u003egetMimetype('file.md');\n\nint $flysystem-\u003egetTimestamp('file.md');\n\nstring $flysystem-\u003egetVisibility('file.md');\n\nbool $flysystem-\u003esetVisibility('file.md', 'public'); //or 'private'\n```\n\n[Full API documentation.](http://flysystem.thephpleague.com/api/)\n\n## Use in Laravel\n\n1. Register `config/app.php`:\n\n  ```php\n  Freyo\\Flysystem\\QcloudCOSv3\\ServiceProvider::class,\n  ```\n\n2. Configure `config/filesystems.php`:\n\n  ```php\n  'disks'=\u003e[\n      'cosv3' =\u003e [\n          'driver' =\u003e 'cosv3',\n          'protocol' =\u003e env('COSV3_PROTOCOL', 'http'),\n          'domain' =\u003e env('COSV3_DOMAIN'),\n          'app_id' =\u003e env('COSV3_APP_ID'),\n          'secret_id' =\u003e env('COSV3_SECRET_ID'),\n          'secret_key' =\u003e env('COSV3_SECRET_KEY'),\n          'timeout' =\u003e env('COSV3_TIMEOUT', 60),\n          'bucket' =\u003e env('COSV3_BUCKET'),\n          'debug' =\u003e env('COSV3_DEBUG', false),\n      ],\n  ],\n  ```\n### Usage\n\n```php\n$disk = Storage::disk('cosv3');\n\n// create a file\n$disk-\u003eput('avatars/1', $fileContents);\n\n// check if a file exists\n$exists = $disk-\u003ehas('file.jpg');\n\n// get timestamp\n$time = $disk-\u003elastModified('file1.jpg');\n\n// copy a file\n$disk-\u003ecopy('old/file1.jpg', 'new/file1.jpg');\n\n// move a file\n$disk-\u003emove('old/file1.jpg', 'new/file1.jpg');\n\n// get file contents\n$contents = $disk-\u003eread('folder/my_file.txt');\n\n// get url\n$url = $disk-\u003eurl('new/file1.jpg');\n\n// create a file from remote(plugin support)\n$disk-\u003eputRemoteFile('avatars/1', 'http://example.org/avatar.jpg');\n$disk-\u003eputRemoteFileAs('avatars/1', 'http://example.org/avatar.jpg', 'file1.jpg');\n```\n\n[Full API documentation.](https://laravel.com/api/5.4/Illuminate/Contracts/Filesystem/Cloud.html)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreyo%2Fflysystem-qcloud-cos-v3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffreyo%2Fflysystem-qcloud-cos-v3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreyo%2Fflysystem-qcloud-cos-v3/lists"}