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 2w ago

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 13% 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://avatars.githubusercontent.com/u/871929?v=4)[Daniel Sitek](/maintainers/danielsitek)[@danielsitek](https://github.com/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

[goat1000/svggraph

Generates SVG graphs

133890.0k3](/packages/goat1000-svggraph)[imagekit/imagekit

PHP library for Imagekit

46877.3k10](/packages/imagekit-imagekit)[gravatarphp/gravatar

Gravatar URL builder which is most commonly called as a Gravatar library

12644.1k2](/packages/gravatarphp-gravatar)

PHPackages © 2026

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