1. Go to this page and download the library: Download mocode/flysystem-aliyunoss 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/ */
mocode / flysystem-aliyunoss example snippets
use League\Flysystem\Filesystem;
use Mocode\Flysystem\AliyunOss\AliyunOssAdapter;
use OSS\OssClient;
$accessId = 'Aliyun Oss Access Id';
$accessKey = 'Aliyun Oss Access Key';
$endPoint = 'Aliyun Oss endPoint';
$bucket = 'Aliyun Oss Bucket';
$domain = 'Aliyun Oss CDN Domain';
$client = new OssClient($accessId, $accessKey, $endPoint);
$adapter = new AliyunOssAdapter($client, $bucket, $domain);
$flysystem = new Filesystem($adapter);