在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):aternosorg/codex-minecraft开源软件地址(OpenSource Url):https://github.com/aternosorg/codex-minecraft开源编程语言(OpenSource Language):PHP 100.0%开源软件介绍(OpenSource Introduction):Codex for MinecraftAboutCodex (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 Minecraft server logs including detectors, parsers and analysers to work with different Minecraft server log files. Installation
UsageThis is only an introduction to the Minecraft 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\Minecraft\Log\VanillaLog();
$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\Minecraft\Detective\Detective();
$detective->setLogFile($logFile);
$log = $detective->detect(); Parse the log content[see codex#parsing] <?php
$log->parse(); Analyse the log[see codex#analysing] <?php
$analysis = $log->analyse(); The <?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();
}
} TranslationsThe output messages, e.g. for problems and solutions are translated by the See the current translation status here: TRANSLATION.md <?php
\Aternos\Codex\Minecraft\Translator\Translator::getInstance()->setLanguage("de"); |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论