maurit/s3filesystem 问题修复 & 功能扩展

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

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

maurit/s3filesystem

Composer 安装命令:

composer require maurit/s3filesystem

包简介

S3 filesystem with caching & control

README 文档

README

S3 filesystem with caching

Usage

installation

composer require maurit/s3filesystem

declaration

$s3storage = new \Maurit\S3filesystem\S3Storage([
    'region'         => 's3_config_region', // required
    'endpoint'       => 's3_config_endpoint_url', // required
    'key'            => 's3_public_key', // required
    'secret'         => 's3_private_key', // required
    'bucket'         => 's3_bucket_name', // required
    'version'        => 's3_config', // optional default 2006-03-01
    'cacheDirectory' => 'path_to_save_cache', // optional default cache in current dir
    'cacheLifetime'  => 'cace_lifetime_in_seconds', // optional default 60*60 (1 hour)
]);

get file methods

$s3storage->get('object_key'); // return symfony response object
$s3storage->render('object_key); // return file content (symfony response method send)
$s3storage->getDownload('object_key'); // return file like attachment
$s3storage->getFile('object_key'); // return array file body and header 

put file methods

/**
 * @param string $key objec_key
 * @param string $value file content, or file path
 * @param bool $public bool default false, true is public-read, false authenticated-read
 * @param bool $fromFile bool default false, true if value is file path 
 */

$s3storage->put($key, $value, $public, $fromFile); // upload one file to s3
$s3storage->putMany([
    'object_key' => 'file content'
], $public, $fromFile); // upload more files from array to s3
$s3storage->putFromFolder('path_from_in_your_machine', 'path_to_in_s3'); // upload full path from your machine to s3

removing methods

$s3storage->forget('object_key'); // remove object from cache
$s3storage->delete('object_key'); // remove file from s3 and remove from cache

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-07-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固