huang-yi/aliyun-oss

Unofficial Aliyun OSS SDK for PHP

0.1.0 2018-09-12 06:54 UTC

This package is auto-updated.

Last update: 2024-12-12 21:54:15 UTC


README

This package provides an unofficial Aliyun OSS SDK for PHP.

Usage

<?php

require __DIR__ . '/vendor/autoload.php';

use HuangYi\AliyunOss\OssClient;

$bucketName = 'bucket';
$endpoint = 'oss-cn-hangzhou.aliyuncs.com';
$accessKeyId = 'access_key_id';
$accessKeySecret = 'access_key_secret';

$client = new OssClient($bucketName, $endpoint, $accessKeyId, $accessKeySecret);

// Service APIs
$client->service->getService();

// Bucket APIs
$client->bucket->getBucket();

// Object APIs
$client->object->putObject('new-object', 'contents');