Supper quick use Aliyun OSS or Tencent COS or Qiniu Koa to get、put、delete Object.

Overview

介绍(oss-utils)

一个集成阿里云、腾讯云、七牛云对象存储的工具类

An SDK integrating Alibaba cloud, Tencent cloud and qiniu cloud object storage

超级快速使用阿里云OSS或腾讯COS及七牛云Koa获取、放置、删除对象

Supper quick use Aliyun OSS or Tencent COS or Qiniu Koa to get、put、delete Object.

安装(Installation)

composer require china-lishuo/oss-utils

案列(example)

init($config) // 初始化配置 ->bucket("存储桶名称"); // 指定操作的存储桶 // 查看文件列表 $storage->get(10); // 指定查看10条 // 上传文件 $path = "./test.jpg"; $result = $storage->put("test.jpg", $path); // 删除文件 $keys = ['test.jpg']; $result = $storage->delete($keys); ">
use lishuo\oss\Manager;
use lishuo\oss\storage\StorageConfig;

    // 参数1:string $appId
    // 参数2:string $appKey
    // 参数3:string $region 地域名、比如(1)阿里云上海为例(http://oss-cn-shanghai.aliyuncs.com)(2)腾讯云上海为例(sh)直接地域名首字母即可(3)其它Region请按实际情况填写。
    
    $config = new StorageConfig("控制台查看获取", "控制台查看获取", "七牛云不需要配置这个参数,留空字符串");

    $storage = Manager::storage("云存储厂商") // 阿里云:aliyun、腾讯云:tencent、七牛云:qiniu
        ->init($config) // 初始化配置
        ->bucket("存储桶名称"); // 指定操作的存储桶

    // 查看文件列表
    $storage->get(10); // 指定查看10条
    // 上传文件
    $path = "./test.jpg";
    $result = $storage->put("test.jpg", $path);
    // 删除文件
    $keys = ['test.jpg'];
    $result = $storage->delete($keys);

报错参考(Error reporting)

腾讯云本地上传报错:cURL error 60: SSL certificate problem: self signed certificate in certificate chain

解决方案:https://juejin.cn/post/7012052806337036301/

You might also like...
A quick naked theme to demonstrate how easy it is to support Gutenberg using ACF blocks

ACF Gutenberg Demo Theme A quick naked theme to demonstrate how easy it is to support Gutenberg using ACF blocks demo.mp4 Files I have found a useful

Phalcon Builder - is a packaging system that make it easy and quick to build Phalcon packages such as rpms, debs, etc. Phalcon's distribution that hosted at PackageCloud.
Phalcon Builder - is a packaging system that make it easy and quick to build Phalcon packages such as rpms, debs, etc. Phalcon's distribution that hosted at PackageCloud.

Phalcon Builder - is a packaging system that make it easy and quick to build Phalcon packages such as rpms, debs, etc. Phalcon's distribution that hos

BreadBooru is a light, quick, and easy to setup imageboard with themes, images, and video support
BreadBooru is a light, quick, and easy to setup imageboard with themes, images, and video support

BreadBooru a bad imageboard, that has nothing to do with (dan/gel)booru, and yet still has booru in the name BreadBooru is a light, quick, and easy to

Quick package/plugin/component (repo) lookup for your favourite package managers
Quick package/plugin/component (repo) lookup for your favourite package managers

Package Managers (Download latest release) Package Repo Search Quick package/plugin/component (repo) lookup for your favourite package managers.

Quick start -d/reload/restart/stop hyperf(~2.1.0 & ~2.2.0) server

hyperf-helper 1. quick start -d/reload/restart/stop server 2. support hyperf ~2.1.0 & ~2.2.0 3. support CentOS7+, Ubuntu 18.0.4+, macOS 4. support swo

This component, based on the Symfony serializer and async-aws, is a human-readable and quick abstraction to easily store serialized objects in DynamoDB 🚀.

DynamoDB Storable This component, based on the Symfony serializer and async-aws, is a human-readable and quick abstraction to easily store serialized

Quick start Symfony 5 project via docker-compose

Quick Docker Symfony This repository will allow you to start a Symfony project very quickly with PostgreSQL 14, pgAdmin 4 and one of three php version

ATVController for android devices running with RDM POGO ATLAS. Quick, simple and dirty add controls with a GUI view

ATVController - WIP - Much to add and fix. ATVController for android devices running with RDM POGO ATLAS. Quick, simple and dirty adb controls wit

A quick,easy and safe way of accessing Mysql-like databases from within a PHP program

Mysqli-Safe A simple, easy-to-use and secure way of accessing a Mysql database from within your PHP programs Mysqli-safe is a wrapper around the mysql

Owner
null
Safely break down arrays or objects, and put them back together in new shapes.

traverse/reshape traverse() and reshape() are companion functions that safely break down arrays or objects and put them back together in new shapes. t

Alley Interactive 2 Aug 4, 2022
A Qiniu Storage filesystem for Laravel

Laravel filesystem Qiniu Qiniu storage for Laravel based on overtrue/flysystem-qiniu. Requirement PHP >= 5.5.9 Installation $ composer require "overtr

安正超 463 Dec 6, 2022
Shell Tools for Qiniu Cloud

qshell 简介 qshell是利用七牛文档上公开的API实现的一个方便开发者测试和使用七牛API服务的命令行工具。该工具设计和开发的主要目的就是帮助开发者快速解决问题。目前该工具融合了七牛存储,CDN,以及其他的一些七牛服务中经常使用到的方法对应的便捷命令,比如b64decode,就是用来解码七

Qiniu Cloud 956 Dec 26, 2022
An article about alternative solution for convert object into a JSON Object for your api.

Do we really need a serializer for our JSON API? The last years I did build a lot of JSON APIs but personally was never happy about the magic of using

Alexander Schranz 1 Feb 1, 2022
Your alter ego object. Takes the best of object and array worlds.

Supporting Opensource formapro\values is an MIT-licensed open source project with its ongoing development made possible entirely by the support of com

FormaPro 31 Jun 25, 2021
Automatically delete old SiteTree page versions from Silverstripe

Version truncator for Silverstripe An extension for Silverstripe to automatically delete old versioned DataObject records from your database when a re

Ralph Slooten 35 Dec 7, 2022
CRUD Build a system to insert student name information, grade the class name, and edit and delete this information

CRUD Build a system to insert student name information, grade the class name, and edit and delete this information

Sajjad 2 Aug 14, 2022
A plugin to make life easier for users who need to edit specific functions of a world and also create, rename and delete worlds quickly using commands or the world management menu.

A plugin to make life easier for users who need to edit specific functions of a world and also create, rename and delete worlds quickly using commands or the world management menu.

ImperaZim 0 Nov 6, 2022
uses laravel breeze , CRUD, soft delete, Factories

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Roman Hossain Shaon 2 Sep 27, 2022
PHP Unoconv - An Object Oriented library which allow easy to use file conversion with Unoconv.

An Object Oriented library which allow easy to use file conversion with Unoconv. Install The recommended way to install PHP-Unoconv is thr

Alchemy 69 Dec 3, 2022