PHPackages                             renatorib/otinfo - 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. renatorib/otinfo

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

renatorib/otinfo
================

Open Tibia Server Info Parser

191010PHP

Since May 27Pushed 10y ago9 watchersCompare

[ Source](https://github.com/renatorib/otinfo)[ Packagist](https://packagist.org/packages/renatorib/otinfo)[ RSS](/packages/renatorib-otinfo/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

OTServer Info [![Build Status](https://camo.githubusercontent.com/5b330c25ed24f5888ad05bf6620bd7815632036d8ca864f5e2b03e2066b7c65b/68747470733a2f2f7472617669732d63692e6f72672f72656e61746f7269622f6f74696e666f2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/renatorib/otinfo)
=============================================================================================================================================================================================================================================================================================

[](#otserver-info-)

Catch information from servers' response by ip and port

Install
-------

[](#install)

Just download this repo, and include otinfo.php **Important:** Must have a writable `cache` folder in the same level of `otinfo.php` or will not work correctly

```
include('otinfo.php');
```

Get started
-----------

[](#get-started)

**To instantiate an otserv, create a new Otinfo object**

```
$server = new Otinfo\Otinfo('shadowcores.twifysoft.net');
```

The first parameter is the server `$ip`, and the second is the `$port` (defined 7171 as default)

**Get informations**

```
if ($server->execute()) {
  echo "Players online: " . $server->players['online'] . "";
  echo "Server location: " . $server->serverinfo['location'] . "";
  echo "Client version: " . $server->serverinfo['client'] . "";
  // these are just a few examples
} else {
  echo "Server offline";
  // if execute() returns false, the server are offline
}
```

The `execute()' method catch/parse the responses returned by server and return false if server are offline.

Possible responses
------------------

[](#possible-responses)

**Each server has its own response, and may be different from the others. This means that not all respond with the same information, and a server may have information that others do not have.**

Here are some possible answers nodes

- `players`
- `serverinfo`
- `motd`
- `owner`
- `monsters`
- `map`
- `npcs`
- maybe others

This means if you want to test, can `print_r`, `var_dump`, and whatelse, the nodes to know returned responses

```
print_r($server->players);
print_r($server->serverinfo);
//etc
```

Cache
-----

[](#cache)

Otinfo cache itself not only for performance, but also to avoid empty responses, caused due to the protection of tfs. As said before, you must have a writable `cache` folder in the same level of `otinfo.php` or will not work correctly. The time of cache as default 180 seconds (three minutes). May you edit in `otinfo.php` changing this line

```
private static $cache = 180; //seconds you want
```

Timeout
-------

[](#timeout)

When the connection is bad, you can increase the timeout

```
private static $timeout = 5; //seconds you want
```

**Made with ❤️ by Renato Ribeiro and Ranieri Althoff**

**Contributors** - my heartfelt thanks

- gpedro
- rmobis
- yrpen
- DSpeichert

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 60% 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://www.gravatar.com/avatar/22fcfa5215399ab24af7acd8870c9e004c2f0f239226beed7eee60047b63d7d2?d=identicon)[renatorib](/maintainers/renatorib)

---

Top Contributors

[![gpedro](https://avatars.githubusercontent.com/u/2898638?v=4)](https://github.com/gpedro "gpedro (9 commits)")[![ranisalt](https://avatars.githubusercontent.com/u/1993083?v=4)](https://github.com/ranisalt "ranisalt (4 commits)")[![DSpeichert](https://avatars.githubusercontent.com/u/1254971?v=4)](https://github.com/DSpeichert "DSpeichert (1 commits)")[![rmobis](https://avatars.githubusercontent.com/u/2119933?v=4)](https://github.com/rmobis "rmobis (1 commits)")

### Embed Badge

![Health badge](/badges/renatorib-otinfo/health.svg)

```
[![Health](https://phpackages.com/badges/renatorib-otinfo/health.svg)](https://phpackages.com/packages/renatorib-otinfo)
```

###  Alternatives

[mtdowling/jmespath.php

Declaratively specify how to extract elements from a JSON document

2.0k472.8M135](/packages/mtdowling-jmespathphp)[opis/closure

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

2.6k230.0M284](/packages/opis-closure)[masterminds/html5

An HTML5 parser and serializer.

1.8k242.8M229](/packages/masterminds-html5)[sabberworm/php-css-parser

Parser for CSS Files written in PHP

1.8k191.2M65](/packages/sabberworm-php-css-parser)[michelf/php-markdown

PHP Markdown

3.5k52.4M345](/packages/michelf-php-markdown)[jms/metadata

Class/method/property metadata management in PHP

1.8k152.8M88](/packages/jms-metadata)

PHPackages © 2026

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