PHP code example of bingher / obs

1. Go to this page and download the library: Download bingher/obs library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

bingher / obs example snippets


$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);
shell
composer 
shell
composer 
shell
composer 
shell
composer