PHPackages                             gnat/super-score - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. gnat/super-score

ActiveProject[Utility &amp; Helpers](/categories/utility)

gnat/super-score
================

Mobile game leaderboards, currency log, and user data storage in PHP.

611

Since Sep 14Compare

[ Source](https://github.com/gnat/super-score)[ Packagist](https://packagist.org/packages/gnat/super-score)[ RSS](/packages/gnat-super-score/feed)WikiDiscussions Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

[![Super Score](https://camo.githubusercontent.com/9d167e03acd76ec8dffb448e9d5d953f0cb854f4a0c4213f4e048e91888b2957/687474703a2f2f692e696d6775722e636f6d2f6b5856724949442e706e67)](https://camo.githubusercontent.com/9d167e03acd76ec8dffb448e9d5d953f0cb854f4a0c4213f4e048e91888b2957/687474703a2f2f692e696d6775722e636f6d2f6b5856724949442e706e67)

[![Build Status](https://camo.githubusercontent.com/752d718520f35b4311fd88feb94af590fa368a096ef915b575400430b02c6a6a/68747470733a2f2f7472617669732d63692e6f72672f676e61742f73757065722d73636f72652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/gnat/super-score)

Game leaderboards, in-game currency logging, and player data storage.

Written by Nathaniel Sabanski.

### Features

[](#features)

- Unlimited score leaderboards with offset querying.
- In-game currency transaction logging with secure hash system.
- Storage of miscellaneous User data.
- Tiny codebase which can be easily added to and security audited.
- Test suite.

### Requirements

[](#requirements)

- PHP 7+ or 5.3+.
- Apache 2+ (mod\_rewrite enabled) or nginx.

### Optional

[](#optional)

- Redis and APCu may be installed for a high performance tiered cache.
- PHPUnit may be installed to run the tests.

### Installation Notes

[](#installation-notes)

1. Development and production configurations can be set in `src/config/Config.php`
2. Set up your database tables using `install.sql`. You can use `mysql -uUser -pPassword -e "create database superscore; use superscore; source install.sql;"` or by importing the SQL file manually using any database management software.
3. If using nginx, enable routing by using a server rule to route to `index.php`. This is achieved in Apache using `mod_rewrite` and the `.htaccess` file.
4. Remember to switch your `Config()` from 'development' to 'production' in `index.php` before going live!

### REST API Usage

[](#rest-api-usage)

**Any error will contain the following JSON response.**

`{ "Error" : "Reason for failure." }`

**Current Time**

Retrieve the current unix timestamp on this server.

Endpointhttp://{hostname}/timestampInputNoneOutput`{ "Timestamp" :  }`File`src/Controller/Timestamp.php`**Leaderboard Score Recording**

Accepts and records scores posted for a User and calculates their current rank in the specified Leaderboard. Returns the User and Leaderboard passed in with the Users highest score for the given Leaderboard.

Endpointhttp://{hostname}/score/saveInput`{ "UserId" : , "LeaderboardId" : , "Score" :  }`Output`{ "UserId" : , "LeaderboardId" : , "Score" : , "Rank" :  }`File`src/Controller/Score.php`**Leaderboard Score Query**

Returns a range of entries from the specified Leaderboard in order of rank, along with the score and rank of the specified User. Higher score is better, ranks start at 1.

Endpointhttp://{hostname}/score/loadInput`{ "UserId" : , "LeaderboardId" : , "Offset" : , "Limit" : }`Output`{ "UserId" : , "LeaderboardId" : , "Score" : , "Rank" : , "Entries" : [ {"UserID" : , "Score" : , "Rank" : }, ... ] }`File`src/Controller/Score.php`**Game Currency Transaction Recording**

Record simple user transactions involving game currency with hash verification. Duplicate transactions will respond with an error.

The Verifier parameter is a SHA-1 hash of the following values concatenated together: `SecretKey+TransactionId+UserId+CurrencyAmount`

Endpointhttp://{hostname}/transaction/saveInput`{ "TransactionId" : , "UserId" : , "CurrencyAmount" : , "Verifier" :  }`Output`{ "Success" : true }`File`src/Controller/Transaction.php`**Game Currency Transaction Query**

Returns basic details of transactions recorded for the User specified.

Endpointhttp://{hostname}/transaction/loadInput`{ "UserId" :  }`Output`{ "UserId" : , "TransactionCount" : , "CurrencySum" :  }`File`src/Controller/Transaction.php`**User Data Save**

Storage for arbitrary JSON data for User. If any key inside storage already exists for the User, the value will be overridden by the passed up value; otherwise the data will be assumed to be unchanged.

Endpointhttp://{hostname}/user/saveInput`{ "UserId" : , "Data" : {  } }`Output`{ "Success" : true }`File`src/Controller/User.php`**User Data Load**

Returns an aggregation of all previous data stored for User.

Endpointhttp://{hostname}/user/loadInput`{ "UserId" :  }`Output`{  }`File`src/Controller/User.php`### Using Composer

[](#using-composer)

Install [Composer](https://getcomposer.org/) and use:

`composer create-project -s dev --prefer-dist gnat/super-score .`

### License

[](#license)

This project is licensed under the MIT License. This means you can use and modify it for free in private or commercial projects.

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community6

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/98193314?v=4)[geenat](/maintainers/geenat)[@GeeNat](https://github.com/GeeNat)

---

Top Contributors

[![gnat](https://avatars.githubusercontent.com/u/24665?v=4)](https://github.com/gnat "gnat (21 commits)")

### Embed Badge

![Health badge](/badges/gnat-super-score/health.svg)

```
[![Health](https://phpackages.com/badges/gnat-super-score/health.svg)](https://phpackages.com/packages/gnat-super-score)
```

###  Alternatives

[nahid/linkify

Converts URLs and email addresses in text into HTML links its extended from Misd\\Linify its also support laravel 5

11138.9k1](/packages/nahid-linkify)

PHPackages © 2026

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