PHPackages                             publicuhc/skin-cache - 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. [Caching](/categories/caching)
4. /
5. publicuhc/skin-cache

ActiveLibrary[Caching](/categories/caching)

publicuhc/skin-cache
====================

Serve Minecraft skins locally

1.0.1(11y ago)165GPL-3.0+PHP

Since Jun 17Pushed 11y ago1 watchersCompare

[ Source](https://github.com/Eluinhost/skin-cache)[ Packagist](https://packagist.org/packages/publicuhc/skin-cache)[ RSS](/packages/publicuhc-skin-cache/feed)WikiDiscussions master Synced 5d ago

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

SkinCache
=========

[](#skincache)

[![SensioLabsInsight](https://camo.githubusercontent.com/3c1f2200e57a567aa37b981df12aac2e8a4722bc08fb3dddd46e8f943bfe6aef/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f62643933386537322d623534362d343531632d626132302d3062633631366536333739312f736d616c6c2e706e67)](https://insight.sensiolabs.com/projects/bd938e72-b546-451c-ba20-0bc616e63791)

Cache Minecraft skins/icons and serve them locally.

Dependencies
------------

[](#dependencies)

All dependencies are handled by composer. Installing cURL is recommended and will be used if installed but it isn't required.

Usage
-----

[](#usage)

There is a class `PublicUHC\SkinCache\SimpleSkinFetcher` that uses some default classes and can be used like this:

```
$fetcher = new SimpleSkinFetcher('https://minotar.net', 10, './cache', 3600);

```

To change the classes used or for better tweaking use the class `PublicUHC\SkinCache\SkinFetcher`.

It requires a Downloader, a Formatter, a PoolInterface and a ErrorImagePainter. It also requires a 'ttl', either null to store forever, an integer as the number of seconds until expiry or a DateTime for when the fetched skins should expire.

### Downloader

[](#downloader)

There is only 1 implementation of downloader available:

`PublicUHC\SkinCache\Downloaders\MinotarLikeDownloader`

It fetches from a base URL supplied in a minotar-like fashion.

Skins are fetched from `/skin/`

Helms are fetched from `/helm//.png`

Heads are fetched from `/avatar//.png`

It expects a `GuzzleHttp\Client` object initialized for getting the data with. At minimum a base\_url needs to be set.

```
$client = new GuzzleHttp\Client(['base_url' => 'https://minotar.net/']);

```

For more information on the Client object visit [the Guzzle project on GitHub](https://github.com/guzzle/guzzle)

It also expects a timeout in seconds for the fetching.

Example for fetching from minotar.net with a 30 second timeout:

```
$downloader = new MinotarLikeDownloader(new Client(['base_url' => 'https://minotar.net/']), 30);

```

### Formatter

[](#formatter)

NOTE: Only the raw images are cached, any formatting is applied to the raw images

There are 3 implementations of the formatter available:

`PublicUHC\SkinCache\Formatters\HttpResponseFormatter`

It formats the images in a Symfony HttpResponse format from the [Symfony Http Foundation project](https://github.com/symfony/HttpFoundation)

`PublicUHC\SkinCache\Formatters\RawImageFormatter`

Returns the image as the raw image string

`PublicUHC\SkinCache\Formatters\GreyscaleFormatter`

Returns the image as a greyscale version of itself

Formatters can be chained to make multiple formatting passes:

```
$formatter = (new GreyscaleFormatter())->then(new HttpResponseFormatter());

```

This will first make it greyscale and then make it a Http Foundation response.

### PoolInterface

[](#poolinterface)

Expects a PoolInterface from the [Stash PHP Project](https://github.com/tedious/Stash).

Example - throws away objects, no cache:

```
$pool = new Pool(new BlackHole());

```

Example - using the default Ephemeral driver:

```
$pool = new Pool();

```

### ErrorImagePainter

[](#errorimagepainter)

There is only 1 implementation of the error image painter available:

`PublicUHC\SkinCache\Painters\TransparentImagePainter`

It will return a transparent image of the same dimensions for error images

### Full Example

[](#full-example)

The following example uses the MinotarLikeDownloader to fetch skins from the official minotar site, formats them in Http Foundation Response style and uses the default Ephemeral cache driver and then fetches the helm for the 'ghowden' account 16x16

```
$downloader = new MinotarLikeDownloader(new Client(['base_url'=>'https://minotar.net/']));
$fetcher = new SkinFetcher($downloader, new HttpResponseFormatter(), new Pool(), new TransparentImagePainter());

$fetcher->fetchHelm('ghowden', 16);

```

###  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

Maturity64

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

Every ~35 days

Total

2

Last Release

4316d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7514501?v=4)[Graham Howden](/maintainers/Eluinhost)[@Eluinhost](https://github.com/Eluinhost)

---

Top Contributors

[![Eluinhost](https://avatars.githubusercontent.com/u/7514501?v=4)](https://github.com/Eluinhost "Eluinhost (83 commits)")

---

Tags

cacheminecraftminotarskins

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/publicuhc-skin-cache/health.svg)

```
[![Health](https://phpackages.com/badges/publicuhc-skin-cache/health.svg)](https://phpackages.com/packages/publicuhc-skin-cache)
```

###  Alternatives

[gordalina/cachetool

Manage your OPcache &amp; APCu cache through the CLI

1.8k3.7M5](/packages/gordalina-cachetool)[silber/page-cache

Caches responses as static files on disk for lightning fast page loads.

1.3k441.9k6](/packages/silber-page-cache)[tedivm/stash-bundle

Incorporates the Stash caching library into Symfony.

841.4M16](/packages/tedivm-stash-bundle)[yediyuz/laravel-cloudflare-cache

laravel-cloudflare-cache

28239.2k](/packages/yediyuz-laravel-cloudflare-cache)

PHPackages © 2026

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