Giter Site home page Giter Site logo

death-satan / aliyun-oss-thinkphp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alphasnow/aliyun-oss-thinkphp

0.0 0.0 0.0 11 KB

打造ThinkPHP最好的OSS Filesystem扩展

Home Page: https://github.com/alphasnow/aliyun-oss-thinkphp

License: MIT License

PHP 100.00%

aliyun-oss-thinkphp's Introduction

Aliyun-oss-filesystem for ThinkPHP

Latest Stable Version License Build Status Scrutinizer Code Quality Code Coverage

扩展借鉴了一些优秀的代码,综合各方,同时做了更多优化,将会添加更多完善的接口和插件,打造ThinkPHP最好的OSS Filesystem扩展

运行环境

  • PHP 7.0+
  • cURL extension
  • ThinkPHP 6.0+

安装方法

  1. 如果您通过composer管理您的项目依赖,可以在你的项目根目录运行:

     $ composer require alphasnow/aliyun-oss-thinkphp
    

    或者在你的composer.json中声明依赖:

     "require": {
         "alphasnow/aliyun-oss-thinkphp": "~1.0"
     }
    
  2. 修改环境文件.env

    ALIYUN_OSS_ACCESS_ID=
    ALIYUN_OSS_ACCESS_KEY=
    ALIYUN_OSS_BUCKET=
    ALIYUN_OSS_ENDPOINT=oss-cn-shanghai.aliyuncs.com
    ALIYUN_OSS_IS_CNAME=false
    ALIYUN_OSS_CDN_DOMAIN=
    ALIYUN_OSS_IS_SSL=false
    

快速使用

文件上传

use think\facade\Filesystem;
$file = request()->file('image');
$savename = Filesystem::disk('aliyun')->putFile( 'image', $file);

https://www.kancloud.cn/manual/thinkphp6_0/1037639

文件写入

use think\facade\Filesystem;
$filesystem = Filesystem::disk('aliyun');

$filesystem->write('prefix/path/file.txt',file_get_contents('/local/path/file.txt'));

阿里云OSS文档

License

See LICENSE.

aliyun-oss-thinkphp's People

Contributors

alphasnow avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.