php-filesystem:一个PHP文件系统包装器,可在Symfony Project中轻松管理文件系统

  • w5_996613
    了解作者
  • 287.3KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-05-25 06:15
    上传日期
适用于AWS S3的文件系统包装 尽可能简单地管理AWS S3上的远程文件 我使用`MinIO` docker而不是AWS S3进行本地测试 开始 git clone git@github.com:SchwarzIT/php-filesystem.git && cd php-filesystem make install make start 上的MinIO 存取密钥: I3uWTHZGke8RWa1j 秘密密钥: G0OC3OYQ5Qw59z61 上的Symfony demo App MinIO登录凭据 停止 make stop 测试 make test 在纯PHP中使用S3FileSystem // instantiate S3 File system $ s3FileSystem = new S3FileSystem ( $ s3Client , self :: TEST
php-filesystem-master.zip
内容介绍
<div align="center"> <h2>A Filesystem Wrapper for AWS S3</h2> <p>Manage the remote files on AWS S3 simple as possible</p> <p> <a href="#" rel='nofollow' onclick='return false;'> <img src="https://img.shields.io/badge/PRs-Welcome-brightgreen.svg?style=flat-square" alt="PRs Welcome"> </a> <a href="#" rel='nofollow' onclick='return false;'> <img src="https://img.shields.io/badge/License-MIT-brightgreen.svg?style=flat-square" alt="MIT License"> </a> </p> </div> --- ## <div align="center"> <span>I used the `MinIO` docker instead of AWS S3 for local testing</span> </div> ## Start ```bash git clone git@github.com:SchwarzIT/php-filesystem.git && cd php-filesystem make install make start ``` > `MinIO` on http://localhost:9001/ > - Access-Key: `I3uWTHZGke8RWa1j` > - secret-Key: `G0OC3OYQ5Qw59z61` > `Symfony demo App` on https://127.0.0.1:8000/ #### MinIO login credentials ## Stop ```bash make stop ``` ## Test ```bash make test ``` ## Use the `S3FileSystem` in pure PHP ```php // instantiate S3 File system $s3FileSystem = new S3FileSystem($s3Client, self::TEST_S3_BUCKET); // upload a test file $s3FileSystem->save($pngFile); // delete a test file $s3FileSystem->delete($pdfFile); // load a test file $s3FileSystem->get($pdfFile); // more info see S3FileSystemTest.php ``` ## Use the `S3FileSystem` in Symfony Project ```yaml services: Aws\S3\S3Client: arguments: - region: '%env(S3_REGION)%' endpoint: '%env(S3_ENDPOINT)%' version: '2006-03-01' use_path_style_endpoint: true credentials: key: '%env(S3_ACCESS_KEY)%' secret: '%env(S3_ACCESS_SECRET)%' Chapterphp\FileSystem\FileSystemInterface: '@Chapterphp\FileSystem\S3FileSystem' ``` ## Open Todos: - [🔥] implement Symfony 5 Demo with AWS S3 Integraiton - [🔥] update the README: how to config S3 client + S3FileSystem - [🔥] complete the unit tests ## licence MIT [@vikbert](https://vikbert.github.io/)
评论
    相关推荐