aternos/codex-hytale

PHP library to read, parse, print and analyse Hytale log files.

Installs: 42

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/aternos/codex-hytale

v2.0.0 2026-01-23 12:25 UTC

This package is auto-updated.

Last update: 2026-01-23 12:26:02 UTC


README

About

Codex (lat. roughly for "log") is a PHP library to read, parse, print and analyse log files to find problems and suggest possible solutions. This is the implementation for Hytale logs including detectors, parsers and analysers to work with Hytale log files.

Installation

composer require aternos/codex-hytale

Usage

This is only an introduction to the Hytale implementation of Codex, for more information take a look at the Codex repository: aternosorg/codex

Create a log file

[see codex#logfile]

<?php

$logFile = new \Aternos\Codex\Log\File\StringLogFile("This is the log content");
$logFile = new \Aternos\Codex\Log\File\PathLogFile("/path/to/log");
$logFile = new \Aternos\Codex\Log\File\StreamLogFile(fopen("/path/to/log", "r"));

Create log object

[see codex#log]

If you know the log type, you can directly create a new log object.

<?php

$log = new \Aternos\Codex\Hytale\Log\Hytale\HytaleServerLog();
$log->setLogFile($logFile);

Detect the log type

[see codex#detection]

If you don't know the log type, you can let the Detective decide and create a log object.

<?php

$detective = new \Aternos\Codex\Hytale\Detective\Detective();
$detective->setLogFile($logFile);
$log = $detective->detect();

This is currently not too relevant because there is only one Hytale log type implemented.

Parse the log content

[see codex#parsing]

<?php

$log->parse();

Analyse the log

[see codex#analysing]

<?php

$analysis = $log->analyse();

The $analysis object contains problems and information which you can get with the $analysis->getProblems() and $analysis->getInformation() functions or all insights together with $analysis->getInsights().

<?php

foreach ($analysis->getInformation() as $information) {
    echo $information->getLabel() . ": " . $information->getValue();
}

foreach ($analysis->getProblems() as $problem) {
    echo $problem->getMessage();
    foreach($problem->getSolutions() as $solution) {
        echo $solution->getMessage();
    }
}