PHPackages                             chrisdjst/upload-abstractor - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. chrisdjst/upload-abstractor

ActiveLibrary[File &amp; Storage](/categories/file-storage)

chrisdjst/upload-abstractor
===========================

Abstração SOLID para upload com suporte a S3 e armazenamento local.

0.0.5(11mo ago)126MITPHPPHP ^8.1

Since Mar 22Pushed 11mo ago1 watchersCompare

[ Source](https://github.com/chrisdjst/upload-abstractor)[ Packagist](https://packagist.org/packages/chrisdjst/upload-abstractor)[ RSS](/packages/chrisdjst-upload-abstractor/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (3)Versions (7)Used By (0)

Upload Abstraction for PHP
==========================

[](#upload-abstraction-for-php)

*A SOLID file upload layer with support for AWS S3, LocalStack and local filesystem.*

[![PHP Version](https://camo.githubusercontent.com/cc9cdea9aa96b40a822425e981b0a030e3371202973c7d57b74e8e99834f81dc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545382e312d626c7565)](https://camo.githubusercontent.com/cc9cdea9aa96b40a822425e981b0a030e3371202973c7d57b74e8e99834f81dc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545382e312d626c7565)[![License](https://camo.githubusercontent.com/e9aa7dc127b496f63d92b238eca8d381c2154a850afe32c892a61c7fa42b7f13/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f796f757276656e646f722f75706c6f61642d6162737472616374696f6e)](https://camo.githubusercontent.com/e9aa7dc127b496f63d92b238eca8d381c2154a850afe32c892a61c7fa42b7f13/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f796f757276656e646f722f75706c6f61642d6162737472616374696f6e)

🤔 Why?
------

[](#-why)

Uploading files across different environments often requires switching between storage backends. This library provides a clean, testable abstraction over multiple drivers using SOLID principles, making your code easier to maintain and extend.

🚀 Features
----------

[](#-features)

- Upload to Amazon S3, LocalStack, or local filesystem
- List buckets and files
- Create buckets (repositories)
- Interface-driven architecture (SOLID principles)
- Compatible with PHPUnit for automated testing
- Easily extendable with custom drivers

📦 Installation via Composer
---------------------------

[](#-installation-via-composer)

### Local

[](#local)

```
"repositories": [
  {
    "type": "path",
    "url": "../upload-abstraction-php"
  }
],
"require": {
  "yourvendor/upload-abstraction": "*"
}
```

### Packagist

[](#packagist)

```
composer require chrisdjst/upload-abstraction
```

✅ Usage Example
---------------

[](#-usage-example)

```
use UploadAbstraction\UploaderFile;
use UploadAbstraction\Enums\UploaderDriver;

$upload = new UploaderFile(UploaderDriver::S3);
$upload->createRepository('my-bucket');
$upload->upload('my-bucket', 'file.txt', '/tmp/file.txt');
$files = $upload->listObjects('my-bucket');
```

⚙️ Configuration (Optional)
---------------------------

[](#️-configuration-optional)

Create a `.env` file if needed:

```
UPLOAD_DRIVER=s3
AWS_REGION=us-east-1
AWS_ENDPOINT=http://localstack:4566
AWS_ACCESS_KEY_ID=test
AWS_SECRET_ACCESS_KEY=test
```

🧪 Running Tests
---------------

[](#-running-tests)

```
composer install
vendor/bin/phpunit
```

Generate code coverage:

```
vendor/bin/phpunit --coverage-html coverage/
```

🐳 LocalStack Support (Docker)
-----------------------------

[](#-localstack-support-docker)

```
version: "3.8"
services:
    localstack:
        image: localstack/localstack
        ports:
            - "4566:4566"
        environment:
            - SERVICES=s3
            - AWS_DEFAULT_REGION=us-east-1
```

📚 Extendable Architecture
-------------------------

[](#-extendable-architecture)

You can add custom storage drivers by implementing the `UploadAbstraction\Contracts\UploaderDriverInterface` interface. This allows seamless integration with other providers (e.g. Google Cloud Storage, Azure Blob Storage).

📁 Project Structure
-------------------

[](#-project-structure)

- `src/` – Source code
- `tests/` – Unit tests

---

Licensed under MIT. Contributions are welcome!

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance54

Moderate activity, may be stable

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~18 days

Total

5

Last Release

338d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b05fbe4e9dda3765b54bac170790989e853d017bf71af037fea8b4aeccdffdb6?d=identicon)[chrisdjst](/maintainers/chrisdjst)

---

Top Contributors

[![chrisdjst](https://avatars.githubusercontent.com/u/30989810?v=4)](https://github.com/chrisdjst "chrisdjst (14 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/chrisdjst-upload-abstractor/health.svg)

```
[![Health](https://phpackages.com/badges/chrisdjst-upload-abstractor/health.svg)](https://phpackages.com/packages/chrisdjst-upload-abstractor)
```

###  Alternatives

[league/flysystem-aws-s3-v3

AWS S3 filesystem adapter for Flysystem.

1.6k263.6M788](/packages/league-flysystem-aws-s3-v3)[aws/aws-sdk-php-laravel

A simple Laravel 9/10/11/12/13 service provider for including the AWS SDK for PHP.

1.7k35.6M74](/packages/aws-aws-sdk-php-laravel)[humanmade/s3-uploads

WordPress plugin to store uploads on S3

2.1k2.4M8](/packages/humanmade-s3-uploads)[mreduar/s3m

Multipart Uploads using Laravel and AWS S3

173.6k](/packages/mreduar-s3m)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
