PHPackages                             mm0/image-manager - 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. [Image &amp; Media](/categories/media)
4. /
5. mm0/image-manager

ActiveLibrary[Image &amp; Media](/categories/media)

mm0/image-manager
=================

Image manager with AWS S3 integration

13PHP

Since Jan 5Pushed 9y ago1 watchersCompare

[ Source](https://github.com/mm0/image-manager)[ Packagist](https://packagist.org/packages/mm0/image-manager)[ RSS](/packages/mm0-image-manager/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

ImageManager
============

[](#imagemanager)

---

This package is created as a PSR-0 namespaced library that is installable via PHP Composer.

Very little configuration is required to use this library.

Simply configure various image directories to be monitored and automatically pushed to S3, optionally deleting files after upload.

Requirements
------------

[](#requirements)

- PHP 5+
- PHP Composer
- (Optional) AWS CLI
- (Optional) GCS CLI
- (Required for SSH) libssh2-php
- php5-curl (required for guzzle)
- vagrant 1.9
- vagrant-vbguest plugin (vagrant plugin install vagrant-vbguest)

Installation
------------

[](#installation)

Include this repository within your composer.json package of your library

Run `composer install`

If you want to test using Vagrant, be sure to install Ansible dependencies:

`ansible-galaxy install -v -r ansible/requirements.yml -p ansible/roles`

Configuration
-------------

[](#configuration)

### SSH Connection Configuration

[](#ssh-connection-configuration)

```
$ssh_host = "127.0.0.1"; // or DNS name
$ssh_port = 22;
$ssh_user = "vagrant";
$ssh_public_key = "/path/to/public_key";
$ssh_private_key = "/path/to/private_key";

$ssh_config = new \mm0\ImageManager\Configuration\SSH (
    $ssh_host,
    $ssh_port,
    $ssh_user,
    $ssh_public_key,
    $ssh_private_key,
    '',             // ssh key passphrase
    array('hostkey' => 'ssh-rsa')
);

```

We then use this configuration object to create a connection object:

```
$connection = new \mm0\ImageManager\SSH\Connection($ssh_config);
$connection->setSudoAll(true); // set this to true if you are using a non-root user to SSH

```

Alternatively, instead of SSH'ing into your MySQL Box, you can also run this library directly on your server using a LocalShell/Connection Object

### LocalShell Connection Configuration

[](#localshell-connection-configuration)

```
$connection = new \mm0\ImageManager\LocalShell\Connection()

```

### Save Modules

[](#save-modules)

Save Modules determine where we will store our backups. You can specify one or more save modules in an array

To date, we have only implemented AWS S3 and GCS Save Modules. The goal is to have additional modules implemented using the same interfaces for us to be able to archive onto more providers by simply adding the configuration to the save module array

#### AWS S3 Save Module

[](#aws-s3-save-module)

In order to use the local module, we must be using a LocalShell Connection as this library and composer dependency (AWS-PHP-SDK) is required.

With an SSH Connection, we are limited in that we don't have a copy of this library in th

```
// Specify the storage module for the backup to use (local or remote SSH)

$s3_save_module = new \mm0\ImageManager\AWS\Uploader(
    $connection,
    $bucket,
    $region,
    $concurrency
);

```

Usage
-----

[](#usage)

#### For more examples, please see the `./Examples` directory or Tests

[](#for-more-examples-please-see-the-examples-directory-or-tests)

### Testing

[](#testing)

Configuration for AWS, GCS(Optional):

```
You must configure your aws cli by adding api key credentials to:
  /home/vagrant/.aws/boto

and configure gsutil by running
    gsutil configure

 You may have to update tests to reference personal buckets as well.

```

Start Vagrant:

`vagrant up`

Log into VM:

`vagrant ssh`

CD to shared Directory:

`cd /var/www`

Install composer packages:

`composer install --dev`

Create an SSH Key

`ssh-keygen` ( press enter a few times )

`cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys`

Run PHPUnit

`./vendor/bin/phpunit -v --debug`

To see full test coverage, run:

```
./vendor/bin/phpunit --debug --verbose  --coverage-html html

```

TODO
----

[](#todo)

- Finish Testing

License
-------

[](#license)

Copyright (c) 2017, Matt Margolin

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Author Information
------------------

[](#author-information)

[Matt Margolin](mailto:matt.margolin@gmail.com)

[mm0](github.com/mm0) on github

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

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

---

Top Contributors

[![mm0](https://avatars.githubusercontent.com/u/4008256?v=4)](https://github.com/mm0 "mm0 (7 commits)")

### Embed Badge

![Health badge](/badges/mm0-image-manager/health.svg)

```
[![Health](https://phpackages.com/badges/mm0-image-manager/health.svg)](https://phpackages.com/packages/mm0-image-manager)
```

###  Alternatives

[milon/barcode

Barcode generator like Qr Code, PDF417, C39, C39+, C39E, C39E+, C93, S25, S25+, I25, I25+, C128, C128A, C128B, C128C, 2-Digits UPC-Based Extention, 5-Digits UPC-Based Extention, EAN 8, EAN 13, UPC-A, UPC-E, MSI (Variation of Plessey code)

1.5k13.3M39](/packages/milon-barcode)[bkwld/croppa

Image thumbnail creation through specially formatted URLs for Laravel

510496.0k22](/packages/bkwld-croppa)[marc1706/fast-image-size

fast-image-size is a PHP library that does almost everything PHP's getimagesize() does but without the large overhead of downloading the complete file.

959.4M20](/packages/marc1706-fast-image-size)[char0n/ffmpeg-php

PHP wrapper for FFmpeg application

495225.1k1](/packages/char0n-ffmpeg-php)[goat1000/svggraph

Generates SVG graphs

132849.6k3](/packages/goat1000-svggraph)[cohensive/embed

Media Embed (for Laravel or as a standalone).

120370.4k](/packages/cohensive-embed)

PHPackages © 2026

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