How to introduce composer into tp5.1 and download it to sdk? under vendor directory

I reported an error when uploading an image to Aliyun"s oss, downloading oss"s sdk, with composer and then introducing the OssClient class. How to introduce it?

clipboard.png


clipboard.png

Php
Jun.23,2021

first step autoload.php under: require vendor file to the project
second step: use OSSOssClient;

see if it's okay?


you can take a look at the README.md file, which should be written.

in fact, the purpose of the namespace here is for composer to automatically load files that can be loaded into the corresponding directory through the namespace. If you change the directory, the corresponding files will not be loaded automatically. You can take a look at the composer directory of the vendor directory. The first five files show the mapping of the namespace to the actual directory.


originally I was directly use OSS\ OssClient ; that's right.
the reason is that I changed the directory name of sdk. Never change the name of the directory! If you change it, you have to change the path in the auto-load configuration file in the vendor/composer/ directory!


my project uses TP5.0,composer to install aliyun's OSS storage to see if it can solve your problem.

use OSS\OssClient;

read more about the documentation
OSS PHP SDK Quick start

clipboard.png

Menu