utopia-php / storage
A simple Storage library to manage application storage
Installs: 83 612
Dependents: 2
Suggesters: 0
Security: 0
Stars: 28
Watchers: 8
Forks: 63
Open Issues: 20
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.9.*
Requires (Dev)
- laravel/pint: 1.2.*
- phpunit/phpunit: ^9.3
- vimeo/psalm: 4.0.1
- dev-main
- 0.19.2
- 0.19.1
- 0.19.0
- 0.19.0-RC1
- 0.18.x-dev
- 0.18.8
- 0.18.7
- 0.18.6
- 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-chore-remove-compression
- dev-feat-s3-retry-018x
- dev-feat-s3-retry
- dev-chore-remove-expectException
- 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-12-16 13:26:20 UTC
README
Utopia Storage library is simple and lite library for managing application storage. It supports multiple storage adapters. We already support AWS S3 storage, Digitalocean Spaces storage, Backblaze B2 Cloud storage, Linode Object storage and Wasabi Cloud storage. This library is aiming to be as simple and easy to learn and use. This library is maintained by the Appwrite team.
This library is part of the Utopia Framework project.
Getting Started
Install using 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');
System Requirements
Utopia Framework requires PHP 7.4 or later. We recommend using the latest PHP version whenever possible.
Copyright and license
The MIT License (MIT) http://www.opensource.org/licenses/mit-license.php