wark/miniostorage 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

wark/miniostorage

Composer 安装命令:

composer require wark/miniostorage

包简介

minio oss filesystem storage for laravel 5+

README 文档

README

Laravel 5.x DUB DUB DUB DUB DUB

Minio oss filesystem storage for laravel 5+

Minio Server

You can download the minio oss server from here.

Minio is an object storage server. Size of an object can range from a few KBs to a maximum of 5TB.
It is best suited for storing unstructured data such as photos, videos, log files, backups 
and container / VM images. 

Minio server is light enough to be bundled with the application stack, similar to NodeJS, Redis and MySQL.

Installation

####Open the command prompt and type in the following. This will download the package.

composer require wark/miniostorage

####After that, add the ServiceProvider to the providers array in config/app.php

WArk\Minio\Providers\MinioStorageServiceProvider::class,

####You can use the facade for shorter code. Add this to your aliases:

'MinioStorage' => WArk\Minio\Facades\MinioStorage::class,

####To publish the config settings in Laravel 5 use:

php artisan vendor:publish

This will add an miniostorage.php config file to your config folder.

####Set Environment Variable in .env file

MINIO_ACCESS_KEY=<access_key>
MINIO_ACCESS_SECRET=<access_secret>
MINIO_ACCESS_REGION=null
MINIO_BUCKET_NAME=<bucket>
MINIO_ACCESS_ENDPOINT=http://localhost:9000

##Usage

Use it like below: ####Save Image/Video/Object

MinioStorage::store('key/key', Input::file('file'));

Use Input::file('file') to get the uploaded file and put it directly. key/key can be any string.

$data = file_get_contents('data');
MinioStorage::store('key/key', $data, true);

Use the third argument as true to upload the raw data as object.

####Retrieve Image/Video/Object

MinioStorage::get('key/key');

Get the object by key string.

MinioStorage::getWithBucket('bucket', 'key/key');

Specify the bucket and get the object from the bucket.

####List out the objects

MinioStorage::listObjects();

####List out the objects with specified bucket

MinioStorage::listObjectsWithBucket();

Specify the bucket and list out the object from the bucket.

####Remove Object

MinioStorage::removeObject('key');

Delete the specified object

####Remove Object with specified bucket

MinioStorage::removeObjectWithBucket('bucket','key');

Delete the specified object with specified bucket

####Check Bucket Exist

MinioStorage::checkBucketExist('bucketName');

Check if the bucket exist or not. Return true if exist and false otherwise.

####Create Bucket If Not Exist

MinioStorage::createBucketIfNotExist('bucketName');

Create the bucket if the bucket does not exist.

####Create Bucket

MinioStorage::createBucket('bucketName');

Create new bucket

####Create Bucket Async

MinioStorage::createBucketAsync('bucketName');

Create new bucket asynchronously

####Remove Bucket

MinioStorage::removeBucket('bucketName');

Delete the specified bucket

####Remove Bucket Async

MinioStorage::removeBucketAsync('bucketName');

Delete the specified bucket asynchronously

####Copy Object

MinioStorage::copyObject('key', 'toBucketName', 'toKey');

Copy existing object from to another bucket with new key name

####Copy Object From

MinioStorage::copyObjectFrom('fromBucketName', 'key', 'toBucketName', 'toKey');

Copy object from specified bucket to another bucket with new key name

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 1.47k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 0
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-02-23

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固