承接 fhteam/selectel-storage-api 相关项目开发

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

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

fhteam/selectel-storage-api

最新稳定版本:1.2

Composer 安装命令:

composer require fhteam/selectel-storage-api

包简介

Selectel Storage API for PHP

README 文档

README

Selectel Cloud Storage API.

Composer setup

Please do note, that package name changed to fhteam/selectel-storage-api. Old name should still work, though it will no longer be maintained.

    "require": {
        "fhteam/selectel-storage-api": "dev-master"
    }

Authenticating

    $config = include(__DIR__ . '/../data/config.php');
    $container = new Container($config['auth_container']);

    $auth = new CredentialsAuthentication($config['auth_user'], $config['auth_key'], $config['auth_url']);
    $auth->authenticate();

Uploading a file

    $file = new File('test.txt');
    $file->setLocalName(__DIR__ . '/../data/config.php');
    $file->setSize();

    $service = new StorageService($auth);
    $service->uploadFile($container, $file);

Deleting a file

    $file = new File('test.txt');
    $service = new StorageService($auth);
    $service->deleteFile($container, $file);

Parallel operations

If you need to do an operation over several files, consider using parallel versions of operations. When using parallel versions of operations requests are sent to Selectel simultaneously. Execution blocks until all replies are received from server.

For uploadFile() there is uploadFiles(), accepting an array of files to be uploaded into the container. For deleteFile() deleteFiles() is also available etc.

If a parallel operation fails, ParallelOperationException is raised with $errors field ready for inspection

统计信息

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

GitHub 信息

  • Stars: 7
  • Watchers: 6
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0
  • 更新时间: 2015-03-04