PHPackages                             danielsitek/php-random-avatar - 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. danielsitek/php-random-avatar

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

danielsitek/php-random-avatar
=============================

A simple service which delivers a random avatar image as the response for GET request.

06PHP

Since Jul 19Pushed 8y ago1 watchersCompare

[ Source](https://github.com/danielsitek/php-random-avatar)[ Packagist](https://packagist.org/packages/danielsitek/php-random-avatar)[ RSS](/packages/danielsitek-php-random-avatar/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

[![Dependencies](https://camo.githubusercontent.com/fe9e8f7b6604624434d59a1371ff5f84f5d2c997972f18be6bf93e1400b64711/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f757365722f70726f6a656374732f3539366532663933333638623038303036316332633262652f62616467652e7376673f7374796c653d666c61742d726f756e64)](https://www.versioneye.com/user/projects/596e2f93368b080061c2c2be?child=summary)[![Build Status](https://camo.githubusercontent.com/34c07253980cb46b06cf2d5a6647ff21b7d51eea44ba2aa1ca419eacc86f62dd/68747470733a2f2f7472617669732d63692e6f72672f64616e69656c736974656b2f7068702d72616e646f6d2d6176617461722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/danielsitek/php-random-avatar)[![Code Climate](https://camo.githubusercontent.com/d9ea2426f5e086e1d8270de84f3c3696c56fd100e05f1b430e9e22bfaac1266f/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f64616e69656c736974656b2f7068702d72616e646f6d2d6176617461722f6261646765732f6770612e737667)](https://codeclimate.com/github/danielsitek/php-random-avatar)[![Codacy Badge](https://camo.githubusercontent.com/4342c86425b8d18445490b90dc875b3cd79ad03b0294625211e9f9d25146490d/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f3239643461646463643533333430323439633138633464303833663165343166)](https://camo.githubusercontent.com/4342c86425b8d18445490b90dc875b3cd79ad03b0294625211e9f9d25146490d/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f3239643461646463643533333430323439633138633464303833663165343166)

README
======

[](#readme)

Introduction
------------

[](#introduction)

Php-Random-Avatar is a simple service which delivers a random image as the response for GET request. It's a small personal project, built just for fun, learning and experimenting with PHP.

Usage
-----

[](#usage)

### Example

[](#example)

File: `app.php`

```
$avatar = new App\Avatar();
$router = new App\Router($avatar);

$avatar->set_image_root( __DIR__ . '/images' );
$avatar->set_images_array( array(
    'man' => array(
        '/man/001.png',
        '/man/002.png',
        '/man/003.png',
        '/man/004.png',
        '/man/005.png'
    ),
    'woman' => array(
        '/woman/001.png',
        '/woman/002.png',
        '/woman/003.png',
        '/woman/004.png',
        '/woman/005.png'
    )
) );

if ( in_array( @$_SERVER['REMOTE_ADDR'], ['127.0.0.1', 'fe80::1', '::1'] ) ) {
    $router->run();
} else {
    $router->use_https()->run();
}
```

Clone this repository to your server/localhost and open it in your browser.

In browser, you can request avatar image like this:

`/` for random image from any category.

`/man` for random image from the "man" category.

`/woman` for random image from the "woman" category.

License
-------

[](#license)

For more information, see  or the accompanying MIT file.

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

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/a7425759e3c0c1b866504bf0fa551e5e7bf87c73a4de69ecb5acf6211aa7fd93?d=identicon)[danielsitek](/maintainers/danielsitek)

---

Top Contributors

[![danielsitek](https://avatars.githubusercontent.com/u/871929?v=4)](https://github.com/danielsitek "danielsitek (33 commits)")

---

Tags

composerphp5projectrestful

### Embed Badge

![Health badge](/badges/danielsitek-php-random-avatar/health.svg)

```
[![Health](https://phpackages.com/badges/danielsitek-php-random-avatar/health.svg)](https://phpackages.com/packages/danielsitek-php-random-avatar)
```

###  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.0k23](/packages/bkwld-croppa)[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)[netresearch/rte-ckeditor-image

Image support in CKEditor for the TYPO3 ecosystem - by Netresearch

63991.3k4](/packages/netresearch-rte-ckeditor-image)

PHPackages © 2026

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