承接 qgmac/cloud_object_storage 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

qgmac/cloud_object_storage

最新稳定版本:0.1.5

Composer 安装命令:

composer require qgmac/cloud_object_storage

包简介

云对象存储集成客户端

README 文档

README

云对象存储集成客户端.

Installing

$ composer require qgmac/cloud_object_storage -vvv

Usage

$config = [
        'default' => 'cos',//默认
        'disks' => [
            'cos' => [// 腾讯云
                'driver' => 'cos',
                'secret_id' => '',
                'secret_key' => '',
                'region' => '',
                'bucket' => '',
                'url' => '',
            ],
            'obs' => [// 华为云
                'driver' => 'obs',
                'key' => '',
                'secret' => '',
                'bucket' => '',
                'url' => '',
                'endpoint' => '',
            ],
            'oss' => [// 阿里云
                'driver' => 'obs',
                'key' => '',
                'secret' => '',
                'role_arn' => '',//即需要扮演的角色ID,格式为acs:ram::$accountID:role/$roleName
                'bucket' => '',
                'url' => '',
                'endpoint' => '',
            ],
             'ftp' => [
                'driver' => 'ftp',
                'host' => '',
                'port' => 21,
                'username' => '',
                'password' => '',
                'url' => '',
                'timeout' => 5,
            ],
        ],
    ];


$store_key = "/test/test.jpg";
$manager = new Manager($config);
$default_store_url = $manager->store()->uploadFile($_file, $head_url);

$cos_url = $manager->store('cos')->uploadFile($_file, $head_url);
$obs_url = $manager->store('obs')->uploadFile($_file, $head_url);
$oss_url = $manager->store('oss')->uploadFile($_file, $head_url);
$oss_url = $manager->store('ftp')->uploadFile($_file, $head_url);
$manager->store('cos')->deleteFile($store_key) bool;
$manager->store('cos')->getFileUrl($store_key) string;
$manager->store('cos')->exist($store_key) bool;

ps OSS配置参考:使用长期访问凭证

Contributing

You can contribute in one of three ways:

  1. File bug reports using the issue tracker.
  2. Answer questions or fix bugs on the issue tracker.
  3. Contribute new features or update the wiki.

The code contribution process is not very formal. You just need to make sure that you follow the PSR-0, PSR-1, and PSR-2 coding guidelines. Any new code contributions must be accompanied by unit tests where applicable.

License

MIT

统计信息

  • 总下载量: 41
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-07-19