utopia-php / storage
一个简单的存储库,用于管理应用程序存储
0.19.0
2024-09-05 17:00 UTC
Requires
- php: >=8.0
- ext-brotli: *
- ext-fileinfo: *
- ext-lz4: *
- ext-snappy: *
- ext-xz: *
- ext-zlib: *
- ext-zstd: *
- utopia-php/framework: 1.0.*
- utopia-php/system: 0.8.*
Requires (Dev)
- laravel/pint: 1.2.*
- phpunit/phpunit: ^9.3
- vimeo/psalm: 4.0.1
- dev-main
- 0.19.0
- 0.19.0-RC1
- 0.18.5
- 0.18.4
- 0.18.3
- 0.18.2
- 0.18.1
- 0.18.0
- 0.17.0
- 0.16.0
- 0.15.0
- 0.14.0
- 0.13.2
- 0.13.1
- 0.13.0
- 0.12.0
- 0.11.0
- 0.10.0
- 0.9.0
- 0.8.0
- 0.7.1
- 0.7.0
- 0.6.0
- 0.5.1
- 0.5.0
- 0.4.3
- 0.4.2
- 0.4.1
- 0.4.0
- 0.3.0
- 0.2.0
- 0.1.0
- dev-feat-framework-v2-v2
- dev-fix-scandir
- dev-shmul-test
- dev-add-CURLOPT_IPRESOLVE
- dev-feat-use-utopia-base-docker
- dev-tmp-logs
- dev-fix-do-file-specific-issues
- dev-s3-getfiles
- dev-feat-framework-v2
- dev-move-bug-same-path
- dev-feat-list-files-local
- dev-feat-refactor-test
- dev-transfer-chunks
- dev-fix-snappy-build
- dev-fix-storage-issues
- dev-add-get-type
- dev-add-method
- dev-fix-psr-4
- dev-update-wasabi-test
- dev-feat-zstd-compression
- dev-refactor-28-genericS3
- dev-feat-wasabi-adapter
- dev-feat-move-across-device
- dev-fix-chunked-upload-tmp-path
- dev-feat-large-file-support
- dev-doc-new-adapter
- dev-fix-validator-class
- dev-fix-s3-issue
- dev-feat-better-error-on-external-request
- dev-fix-s3-refactor
- dev-feat-new-file-type-validator
This package is auto-updated.
Last update: 2024-09-05 17:01:10 UTC
README
Utopia Storage库是一个简单且轻量级的库,用于管理应用程序存储。它支持多种存储适配器。我们已支持AWS S3存储、Digitalocean Spaces存储、Backblaze B2云存储、Linode对象存储和Wasabi云存储。这个库的目标是尽可能简单、易于学习和使用。此库由Appwrite团队维护。
此库是Utopia Framework项目的一部分。
入门指南
使用composer安装
composer require utopia-php/storage
<?php require_once '../vendor/autoload.php'; use Utopia\Storage\Storage; use Utopia\Storage\Device\Local use Utopia\Storage\Device\S3 use Utopia\Storage\Device\DOSpaces // Instantiating local storage Storage::setDevice('files', new Local('path')); // Or you can use AWS S3 storage Storage::setDevice('files', new S3('path', AWS_ACCESS_KEY, AWS_SECRET_KEY,AWS_BUCKET_NAME, AWS_REGION, AWS_ACL_FLAG)); // Or you can use DigitalOcean Spaces storage Storage::setDevice('files', new DOSpaces('path', DO_SPACES_ACCESS_KEY, DO_SPACES_SECRET_KEY, DO_SPACES_BUCKET_NAME, DO_SPACES_REGION, AWS_ACL_FLAG)); $device = Storage::getDevice('files'); //upload $device->upload('file.png','path'); //delete $device->delete('path');
系统要求
Utopia Framework需要PHP 7.4或更高版本。我们建议在可能的情况下使用最新的PHP版本。
版权和许可
MIT许可(MIT) http://www.opensource.org/licenses/mit-license.php