承接 nece001/php-brawl-filesystem-cos 相关项目开发

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

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

nece001/php-brawl-filesystem-cos

最新稳定版本:1.0.1

Composer 安装命令:

composer require nece001/php-brawl-filesystem-cos

包简介

php 文件系统信基础服务项目(腾讯云cos)

README 文档

README

php 文件存储基础服务适配项目(腾讯云COS)

依赖

composer require qcloud/cos-sdk-v5

示例

    $conf = array(
        'secret_id' => 'xxx',
        'secret_key' => 'xxx',
        'bucket' => 'xxx',
        'region' => 'ap-shanghai',
        'sub_path' => 'uploads/test',
        'base_url' => 'https://xxxxxx'
    );

    $config = FileSystemFactory::createConfig('Cos');
    $config->setConfig($conf);

    $fso = FileSystemFactory::createClient($config);
    try {

        $fso->write('c/' . time() . '.txt', 'test');
        $fso->append('uploads/test/c/1687066427.txt', '[test]');
        $fso->append('uploads/test/c/1687066091.txt', '[test]');

        $fso->copy('uploads/test/c/1687060306.txt', 'a/1.txt');
        $fso->move('uploads/test/c/1687060494.txt', 'a/2.txt');
        $fso->upload('D:\Work\temp\ttt.txt', 'a/3.txt');

        var_dump($fso->exists('uploads/test/c/1687060306.txt'));
        echo $fso->read('uploads/test/c/1687066427.txt');
        $fso->delete('uploads/test/a/3.txt');

        $fso->mkDir('a/d');
        echo $fso->lastModified('uploads/test/c/1687060306.txt');
        echo $fso->fileSize('uploads/test/c/1687066427.txt');
        print_r($fso->readDir('uploads/test/c'));

        echo $fso->getUri(), '<br>';
        echo $fso->getUrl(), '<br>';
        echo $fso->buildPreSignedUrl('uploads/test/c/1687066427.txt');
    } catch (Throwable $e) {
        echo $e->getMessage(), '<br>';
        echo $fso->getErrorMessage();
    }

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-06-24