Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cesurapp/storage-bundle
Symfony Storage Bundle
https://github.com/cesurapp/storage-bundle
package storage-bundle symfony symfony-bundle
Last synced: 4 months ago
JSON representation
Symfony Storage Bundle
- Host: GitHub
- URL: https://github.com/cesurapp/storage-bundle
- Owner: cesurapp
- License: mit
- Created: 2023-12-02T01:57:29.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-31T12:43:36.000Z (8 months ago)
- Last Synced: 2024-09-30T16:20:52.209Z (4 months ago)
- Topics: package, storage-bundle, symfony, symfony-bundle
- Language: PHP
- Homepage:
- Size: 95.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Storage Bundle
[![App Tester](https://github.com/cesurapp/storage-bundle/actions/workflows/testing.yaml/badge.svg)](https://github.com/cesurapp/storage-bundle/actions/workflows/testing.yaml)
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?logo=Unlicense)](LICENSE.md)It is used for file storage. There is no database connection.
Async-aws/s3 package is used for S3 connection.
Tests are available for each driver, any test without access codes is skipped.
You can use multiple drives at the same time. Use MediaBunle to keep track of files.### Supported Drivers
* BackBlaze
* CloudFlare
* Local### Install
Required Symfony 7
```
composer req cesurapp/storage-bundle
```### Configuration
```yaml
# config/packages/storage.yamlstorage:
default: main
devices:
local:
driver: local #backblaze, cloudflare, local
root: "%kernel.project_dir%/storage/files"main:
driver: s3
root: /
accessKey: "access_key"
secretKey: "secret_key"
bucket: "bucket_name"
region: "auto"
endPoint: "https://11d0547262baad2e6bdeb340e88f83be.r2.cloudflarestorage.com"backblaze:
driver: backblaze
root: /
accessKey: "access_key"
secretKey: "secret_key"
bucket: "bucket_name"
region: "auto"
```### Tests
Tests for which access codes are not defined are skipped.
```xml
```
### Usage
```php
public function controllerAction(\Cesurapp\StorageBundle\Storage\Storage $storage) {
// Upload File
$storage->upload('source_path', 'upload_path');
// Write File
$storage->write('upload_path', 'text_content', 'application/text');
// Delete
$storage->delete('file_path');
// Check
$storage->exists('file_path');
// Read
$storage->read('file_path')
}
```