PHPackages                             rogiel/star-replay - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. rogiel/star-replay

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

rogiel/star-replay
==================

A StarCraft II replay parser in PHP

0.1.5(9y ago)1281BSD-2.0PHPPHP &gt;=5.5CI failing

Since Jan 19Pushed 5y ago1 watchersCompare

[ Source](https://github.com/Rogiel/star-replay)[ Packagist](https://packagist.org/packages/rogiel/star-replay)[ Docs](https://rogiel.com/portfolio/star-replay)[ RSS](/packages/rogiel-star-replay/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (3)Versions (7)Used By (0)

Star Replay
===========

[](#star-replay)

This library allows you to read StarCraft II replay files from PHP.

A object-oriented API is provided to browse through all metadata and events available on replays.

Features
--------

[](#features)

- Read .SC2Replay files from all public game versions (data is mined from [s2protocol](https://github.com/Blizzard/s2protocol))
- **Game events**: Streams events using PHP 5 generators
- **Lazy parsing**: Parses only structures you require

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

[](#installation)

The recommended way of installing this library is using Composer.

```
composer require "rogiel/star-replay"

```

This library uses [php-mpq](https://github.com/Rogiel/php-mpq) to parse and extract compressed information inside replays.

Example
-------

[](#example)

```
use Rogiel\StarReplay\Replay;
use Rogiel\StarReplay\Event\Game\CameraSaveEvent;

$replay = new Replay('test.SC2Replay');

echo "Version: " . $replay->getHeader()->getVersion() . "\n";
echo "Map: " . $replay->getMatchInformation()->getTitle() . "\n";
echo "Players:\n";
foreach($replay->getPlayers() as $id => $player) {
	echo "\tPlayer ".$id.": ".$player->getName()."\n";
}

echo "Camera hotkeys:\n";
foreach($replay->getGameEvents() as $timestamp => $event) {
	if($event instanceof CameraSaveEvent) {
		$player = $replay->getPlayers()->getPlayer($event->getHeader()->getUserID());
		echo "\tPlayer ". $player->getName() ." saved a new camera #". $event->getWhich() ." at point ". $event->getTarget() ."\n";
	}
	// since we are using generators, the events will stream linearly from begining to end
}
```

###  Health Score

25

—

LowBetter than 40% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity52

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.

###  Release Activity

Cadence

Every ~42 days

Recently: every ~10 days

Total

6

Last Release

3501d ago

PHP version history (2 changes)0.1.0PHP ^5.5.0

0.1.1PHP &gt;=5.5

### Community

Maintainers

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

---

Top Contributors

[![Rogiel](https://avatars.githubusercontent.com/u/755798?v=4)](https://github.com/Rogiel "Rogiel (12 commits)")

---

Tags

blizzardgamingStarCraft IIReplay parsing

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/rogiel-star-replay/health.svg)

```
[![Health](https://phpackages.com/badges/rogiel-star-replay/health.svg)](https://phpackages.com/packages/rogiel-star-replay)
```

###  Alternatives

[nikic/php-parser

A PHP parser written in PHP

17.4k887.0M1.6k](/packages/nikic-php-parser)[erusev/parsedown

Parser for Markdown.

15.0k150.2M630](/packages/erusev-parsedown)[mtdowling/jmespath.php

Declaratively specify how to extract elements from a JSON document

2.0k463.5M117](/packages/mtdowling-jmespathphp)[opis/closure

A library that can be used to serialize closures (anonymous functions) and arbitrary data.

2.6k228.5M250](/packages/opis-closure)[masterminds/html5

An HTML5 parser and serializer.

1.8k234.7M187](/packages/masterminds-html5)[jms/serializer

Library for (de-)serializing data of any complexity; supports XML, and JSON.

2.3k133.8M779](/packages/jms-serializer)

PHPackages © 2026

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