PHPackages                             rossriley/doctrine-uploader - 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. rossriley/doctrine-uploader

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

rossriley/doctrine-uploader
===========================

Small package to handle file uploads via a save to a Flysystem Handler

1.0(10y ago)238MITPHP

Since Jun 16Pushed 10y ago1 watchersCompare

[ Source](https://github.com/rossriley/doctrine-uploader)[ Packagist](https://packagist.org/packages/rossriley/doctrine-uploader)[ RSS](/packages/rossriley-doctrine-uploader/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (3)Versions (2)Used By (0)

### Doctrine Uploader

[](#doctrine-uploader)

This is a very basic composer package designed to slot into an existing Doctrine ORM based project.

The listener takes care of handling file uploads and saves the resulting path to the Entity.

#### How to bootstrap

[](#how-to-bootstrap)

##### Define your entity targets.

[](#define-your-entity-targets)

This is an array in the format Entity\\Class=&gt;\[field1,field2\] for example.

```
$targets = [
    'Myproject\Entity\User' => ['logo','profilepic'],
    'Myproject\Entity\Company' => ['logo']
];

```

##### Provide a filesystem handler

[](#provide-a-filesystem-handler)

This project uses Flysystem() to handle saves. The simplest usage is as follows.

```
$fsAdapter = new League\Flysystem\Adapter\Local('/path/to/save');
$filesystem = new League\Flysystem\Filesystem($fsAdapter);
$handler = Handler($filesystem);

```

##### Add the listener to your EntityManager setup with the above setup

[](#add-the-listener-to-your-entitymanager-setup-with-the-above-setup)

```
use Doctrine\Uploader\Listener;

$em->getEventManager()->addEventListener([Doctrine\ORM\Events::preUpdate], new Listener($handler, $targets));

```

##### Putting it all together.

[](#putting-it-all-together)

```
use League\Flysystem\Adapter\Local;
use League\Flysystem\Filesystem;
use Doctrine\Uploader\Listener;
use Doctrine\Uploader\Handler;

$targets = [
    'Myproject\Entity\User' => ['logo','profilepic'],
    'Myproject\Entity\Company' => ['logo']
];

$fsAdapter = new Local('/path/to/save');
$filesystem = new Filesystem($fsAdapter);
$handler = Handler($filesystem);

$em->getEventManager()->addEventListener([Doctrine\ORM\Events::preUpdate], new Listener($handler, $targets));

```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

Established project with proven stability

 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

Unknown

Total

1

Last Release

3848d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5082?v=4)[Ross Riley](/maintainers/rossriley)[@rossriley](https://github.com/rossriley)

---

Top Contributors

[![rossriley](https://avatars.githubusercontent.com/u/5082?v=4)](https://github.com/rossriley "rossriley (18 commits)")

### Embed Badge

![Health badge](/badges/rossriley-doctrine-uploader/health.svg)

```
[![Health](https://phpackages.com/badges/rossriley-doctrine-uploader/health.svg)](https://phpackages.com/packages/rossriley-doctrine-uploader)
```

###  Alternatives

[league/flysystem-aws-s3-v3

AWS S3 filesystem adapter for Flysystem.

1.6k263.6M790](/packages/league-flysystem-aws-s3-v3)[unisharp/laravel-filemanager

A file upload/editor intended for use with Laravel 5 to 10 and CKEditor / TinyMCE

2.2k3.3M74](/packages/unisharp-laravel-filemanager)[league/flysystem-sftp-v3

SFTP filesystem adapter for Flysystem.

6129.6M91](/packages/league-flysystem-sftp-v3)[yii2-starter-kit/yii2-file-kit

Yii2 file upload and storage kit

151216.8k6](/packages/yii2-starter-kit-yii2-file-kit)[azure-oss/storage-blob-flysystem

Flysystem adapter for Azure Storage PHP

29936.0k10](/packages/azure-oss-storage-blob-flysystem)[jerodev/flysystem-v3-smb-adapter

SMB adapter for Flysystem v3

1289.9k1](/packages/jerodev-flysystem-v3-smb-adapter)

PHPackages © 2026

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