Skip to content

PBug90/w3gphp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

Warcraft III Replay Parser

Based on the W3G-Parser for PHP created by Julas: https://w3rep.sourceforge.net/

This library should be fully compatible with existing versions, only enhancing its functionality. It adds another property called "json_parsed_full" to the PHP class object that allows retrieval of well-defined data structures.

Supported PHP Versions

The automated test pipeline covers php versions of 7.1, 7.2 and 7.3. Support for older versions is not guaranteed.

Normalized JSON data structures

Can be accessed by using the json_parsed_full property of the Replay object. Currently still work in progress and not 100% reliable yet.

$this->json_parsed_full["teams"] = $teams;
$this->json_parsed_full["game"]  = $this->game;
$this->json_parsed_full["teams_simple"]  =$teams_simple;
$this->json_parsed_full["julas"] = $this->players;
$this->json_parsed_full["w3gplus"]  =$this->arm;

Example usage in a simplified PHP backend script using an uploaded replay file as source.

if (isset($_FILES['custom_replay'])) {
    $replay = new replay($_FILES["custom_replay"]['tmp_name']);    
    print (json_encode($replay->json_parsed_full));
    die;
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages