bingher/obs

api for object storage

1.0.7 2024-08-16 06:41 UTC

This package is auto-updated.

Last update: 2024-11-11 01:20:01 UTC


README

API for object storage server

Support platform

  • huawei OBS
  • minio
  • seaweedFS
  • amazon S3
  • aliyun OSS
  • tencent COS

Installation

  • Install Base library [==requied==]
composer require bingher/obs
composer require obs/esdk-obs-php
  • S3 [==optional==]
composer require aws/aws-sdk-php
composer require aws/aws-sdk-php
composer require aliyuncs/oss-sdk-php
  • COS [==optional==]
composer require qcloud/cos-sdk-v5

Usage

$obs = new bingher\obs\OBS(
    [
        'type'     => 'HwOBS', //[HwOBS,S3,MinIO,AliOSS,COS]
        'endpoint' => 'https://endpoint',
        'bucket'   => 'bucket name',
        'key'      => 'access key',
        'secret'   => 'access secret',
    ]
);

//put object
$obs->put($key,$filePath);

//get object
$obs->get($key,$filePath);

//object preview url
$obs->url($key);

//object put url
$obs->putUrl($key);

//delete object
$obs->delete($key);

//check object exist
$obs->exist($key);

//call any public method of sdk ex:doesObjectExist
$obs->doesObjectExist($key);