marotdc / obs-php8-sdk
OBS PHP8.1+ SDK
dev-main
2023-09-14 01:51 UTC
Requires
- php: >=7.4.0
- guzzlehttp/guzzle: ^6.3.0 || ^7.0
- guzzlehttp/psr7: ^1.4.2 || ^2.0
- monolog/monolog: 3.4.0
This package is not auto-updated.
Last update: 2025-01-03 06:32:02 UTC
README
Forked from https://github.com/huaweicloud/huaweicloud-sdk-php-obs
obs/esdk-obs-php 3.22.6 对php8.1+不友好,一直有弃用警告。因为公司项目急用,所以只是在一些方法上增加了添加 #[\ReturnTypeWillChange]
版本说明
version 1.0.* base on obs/esdk-obs-php 3.22.6
1.0.3 修改 Obs/ObsException.php public function __construct
1.0.2 修复版本号
1.0.1 added #[\ReturnTypeWillChange]
使用方法
composer require marotdc/obs-php8-sdk
<?php require 'vendor/autoload.php'; use Obs\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 ] ); //....... ?>