定制 kialex/bpt-store 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

kialex/bpt-store

最新稳定版本:1.0.8

Composer 安装命令:

composer require kialex/bpt-store

包简介

BPT Cloud File Storage. Keep your file security!

README 文档

README

Installing via Composer

The recommended way to install BPT Store is through Composer.

# Install Composer
curl -sS https://getcomposer.org/installer | php

Next, run the Composer command to install the latest stable version of Guzzle:

composer require kialex/bpt-store

After installing, you need to require Composer's autoloader:

require 'vendor/autoload.php';

Init Client

$client = new \Kialex\BptStore\Client([
    // Necessary
    //
    'login' => 'bpt_store_login',
    'password' => 'bpt_store_password',
    'sandbox' => true, // `false` is Production mode. Default is `false`
    //
    // Optional
    //
    // 'maxAttempts' => 5 // Attempts to reconnect if something went wrong, Default is `3`
    // 'versionNumber' => 1 // API version number, Default is `1`
    // 'url' => ''https://dev-api.bpt-store.com/api/v{apiVersionNumber}/' // API URL, Default: depends of mode
    // See `DEV_URl` and `PROD_URL` constants of class
]);

$bptFileCloud = new \Kialex\BptStore\File($client);

Push file to BPT storage

$fileData = $bptFileCloud->add(
    'path_to_file', // Full path to file or Absolute URL
    445566, // Group Id
    true // If U want to create a private file -> set `false`. Default is `true`.
);

Example content of $fileData

{
    "uuid": "6a29d6bd9267491ab84c6d65280fba1658b6ebbd1689275b408feab2f187e367",
    "name": "Example_File.png",
    "size": 117185,
    "mimeType": "image/png",
    "hash": "58b6ebbd1689275b408feab2f187e367"
}

Get public file URL

$publicUrl = $bptFileCloud->getPublicUrl('58b6ebbd1689275b408feab2f187e367') // Put `hash` from `$fileData`;

Get private file URL

$publicUrl = $bptFileCloud->getPrivateUrl('6a29d6bd9267491ab84c6d65280fba1658b6ebbd1689275b408feab2f187e367') // Put `uuid` from `$fileData`;

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-04-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固