PHP code example of bytepandax / obs-php8-sdk

1. Go to this page and download the library: Download bytepandax/obs-php8-sdk 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/ */

    

bytepandax / obs-php8-sdk example snippets




bs\ObsClient;

// 配置信息
$ak = 'your_access_key';
$sk = 'your_secret_key';
$endpoint = 'your_endpoint';
$bucket = 'your_bucket_name';
$objectKey = 'your_object_key';
$filePath = 'path/to/your/file.txt';

$obsClient = ObsClient::factory ( [
    'key' => $ak,
    'secret' => $sk,
    'endpoint' => $endpoint,
    'socket_timeout' => 30,
    'connect_timeout' => 10
] );

//.......